Character confusion, support world?

Discussion in 'iOS Programming' started by IDMah, Jul 1, 2013.

  1. IDMah macrumors 6502


    May 13, 2011
    Well another entry into the Global High Score sage.

    So I've decided to roll my own Server, all PHP, MySQL, and JSon.
    Which is supported now locally.

    but how do I encode (UTF-8) the MySql so it will be compatible with all languages. So the: Thai, Israeli, Japanese, Chinese (non latin) users won't be slighted. and their names won't end up being gobbly-gook when they see the list.

    I've been using this as framework: PHP, MySQL, and JSon tutorial

    Also would like to keep a local copy of the Global High Score so again.

    How do I encode/font so all characters latin/non-latin show up properly?
    is this going to be hellishly complicated?


    ps. also if someone could point me to an icloud backup tutorial that also would be muchly appreciated!!

    Blatant self promotion follows:
    Dragon Emperor's Challenge iphone
    Dragon Emperor's Challenge HD
    at 0.5 price for the summer enjoy!!!
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    I don't think you can. If it was possible to encode the entire Unicode standard into 8 bits (UTF-8) then there would be no need to have UTF-16...
  3. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Every code point in Unicode is representable in UTF-8. For the large values, the sequence of bytes becomes longer, but every code point up to 31 bits in length is definitely representable as UTF-8.

    To the OP:
    UTF-8 is a multi-byte variable-length encoding of Unicode code points (characters). See the above link. If you do the encoding and decoding correctly, then every Unicode code point is round-trip encodeable and decodeable.

    The conversion between UTF-8 and Unicode code points can be found in any decent Unicode reference. If you haven't looked at anything, or you don't understand what Unicode or its transformation formats are, then you should study the fundamentals first.

    Also, MySQL is specifically mentioned in the above-linked UTF-8 article. You should probably consult the MySQL docs on how it uses Unicode.

Share This Page