SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Divisive Cotton's Avatar
    Join Date
    Jun 2008
    Location
    Andy lives in London, UK
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multibyte String Functions

    All pages I create now are HTML5 and I declare UTF-8 in the header:

    Code:
    <meta charset="utf-8" />
    Is it considered good practice to use the PHP multibyte string functions (http://php.net/manual/en/ref.mbstring.php)? Or if you are not writing code for a multi-lingual user base does it really matter?
    Let everyday be Christmas

  2. #2
    SitePoint Wizard TheRedDevil's Avatar
    Join Date
    Sep 2004
    Location
    Norway
    Posts
    1,191
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Please keep in mind that the meta charset is overwritten by a header stating the content type and the charset. So you should use this in addition: header('Content-Type: text/html; charset=utf-8');

    In the event that your website will only use latin based character there is no need to use multibyte functions, it is first when you either use a multibyte language on the website you need to worry about it. (or if you believe you might use one in the future).

  3. #3
    SitePoint Guru bronze trophy
    Join Date
    Dec 2003
    Location
    Poland
    Posts
    927
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Divisive Cotton View Post
    Is it considered good practice to use the PHP multibyte string functions (http://php.net/manual/en/ref.mbstring.php)? Or if you are not writing code for a multi-lingual user base does it really matter?
    I don't see anything wrong with using multi-byte string functions. If you need them use them, they are enabled on almost every host nowadays.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •