Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

unicode question

 
   Mac (Home) -> Programmer Help RSS
Next:  Using embedded framework for plugins  
Author Message
Paul Fredlein

External


Since: Dec 29, 2008
Posts: 2



(Msg. 1) Posted: Mon Dec 29, 2008 12:46 am
Post subject: unicode question
Archived from groups: comp>sys>mac>programmer>help (more info?)

Hi,

I have a mysql database which returns, to my Cocoa app, simplified
Chinese characters using PHP.

The database seems to store the Chinese as double byte chars which is a
hassle to get them in there in the first place as everything seems to
use some kind of unicode set.

Anyway, so far it all seems to work but I'm convinced it's just good
luck not good management. What should I use throughout to make sure it
doesn't break:-

utf8_unicode_ci
gb2312

or what?

Any help appreciated.

Paul
Back to top
Login to vote
Allen Brunson

External


Since: Aug 29, 2008
Posts: 3



(Msg. 2) Posted: Mon Dec 29, 2008 3:03 am
Post subject: Re: unicode question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Paul Fredlein wrote:
> Anyway, so far it all seems to work but I'm convinced it's just good
> luck not good management. What should I use throughout to make sure it
> doesn't break:-

this sounds too much like programming by guessing. not a good way to go about
it. you should go back through this from the beginning, and figure out what
each piece is doing. how did the data get into the database, what encoding is
the database using, what does the php documentation say, and so on.

generally speaking, in this day and age, you're better off using unicode for
everything, if you can. alas, there is more than one way to encode a series
of unicode characters. utf8 is popular if you have data that is mostly ascii
with the occasional non-ascii character thrown in. most characters are
encoded in only a single byte, with non-ascii characters requiring two or
more. it's not very efficient for languages like chinese, though. in that
case you'd be better off using utf16, where every character is encoded in a
minimum of two bytes.

this topic is way too big to be covered in a single usenet post, so you're
better off reading this:

http://www.joelonsoftware.com/articles/Unicode.html

you mentioned gb2312 at one point, which is definitely *not* unicode. it's an
older encoding commonly used for asian languages. if your input source is
unavoiadably gb2312 or something like it, it's not the end of the world.
macosx contains CFString and NSString methods to convert data in one encoding
to almost any other encoding.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Question about NSTabView - HI I don't know if Gorm/Interface Builder questions are on topic in here, the FAQ doesn't seem to say. Anyway, I had an application working fine with its NSTableView (the delegate was my AppController class). I used Interface Builder to create a..

MTCoreAudio question - Hi, I'm using MTCoreAudio and need to record x seconds (say 5 seconds) of audio into one buffer. I've got the sammple rate but how do I calculate the buffer size? One of the examples I found uses:- // about 25 seconds of recording time #define..

stringWithContentsOfFile question - Using stringWithContentsOfFile I can load an NSString with the contents of a file (obviously). What are the practical limits with regard to the size of file that could be handled? Jim -- Find me at http://www.ursaMinorBeta.co.uk My lucky star is..

One more C++ cout question - I have a hex value, 0x14000, and I want to output it as, 0x00014000. Is it possible to get this output using std::cout? Thanks

Novice question about NSButton - Hello, I have been working my way through developing my first Cocoa app, (a calculator, naturally) and have hit a bit of a wall toward the end. Apologies in advance for the long post. The problem: All my keys are straight NSButtons with a key..
       Mac (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact