• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Japanese Language
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Japanese Language


  • Subject: Re: Japanese Language
  • From: Ricky Sharp <email@hidden>
  • Date: Wed, 15 Jul 2009 18:41:05 -0500


On Jul 15, 2009, at 5:36 PM, Development wrote:

Ok, I lucked out and got a great chance at releasing a bit of software in japan. The problem is that it is 50/50 client to web. My primary concerns are string translation from iPhoneOS to data being stored in a mysql database. I have spent quite a bit of time googling and am still not sure but is the japanese data that will be sent from my application to my server utf-8? Or is it utf-16 as I for some reason thought. Everything sent to the server is pre encoded for transport, stored and then unencoded by the app so I feel at least a level of confidence that if I encode with the correct string encoding my server side will just accept and store the data. I dunno. Maybe I'm completely confused.


You'll want to first understand the encoding of your "endpoints" and then pick an appropriate transport encoding.

In terms of MySQL, you can define the encoding of a column to be something like this:

varchar(100) character set UTF8

Or, pick whatever encoding you deem appropriate (perhaps UTF-16?)

On the iPhone, all textual data in memory (e.g. NSString) will be UTF-16. If you store data in files on the iPhone, you'll want to store them in some well-known encoding. This will typically be UTF-16 especially if you simply archive NSString objects.

As for the transport, I would highly recommend UTF-8 as no byteswapping is needed. For most Latin-based data, the number of bytes taken up in UTF-8 will be less than what is used by UTF-16. For Japanese (and many other languages), the number of bytes of UTF-8 will be more than UTF-16. Just wanted to point that out in case you have insanely strict bandwidth requirements.

Then, it's just a matter of calling the correct APIs at each endpoint to ensure you don't mangle the text.


___________________________________________________________ Ricky A. Sharp mailto:email@hidden Instant Interactive(tm) http://www.instantinteractive.com



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Japanese Language (From: Development <email@hidden>)

  • Prev by Date: Re: Core Data debugging
  • Next by Date: Re: Reference Count Underflow when Writing PDF
  • Previous by thread: Japanese Language
  • Next by thread: Re: Japanese Language
  • Index(es):
    • Date
    • Thread