printing Utf8

2012-10-31 Thread Gerriet M. Denkmann
I print strings like: NSString *s = @ร่วมรส; fprintf(stderr, %s\n, [ s UTF8String]); and usually it just works. But sometimes it does not and I get garbage like: ร่ว\340\270\241รส Converting these numbers to hex one gets: 0xe0 0xb8 0xa1 which is the Utf8-code for THAI CHARACTER

Re: printing Utf8

2012-10-31 Thread Ken Thomases
On Oct 31, 2012, at 9:41 AM, Gerriet M. Denkmann wrote: I print strings like: NSString *s = @ร่วมรส; fprintf(stderr, %s\n, [ s UTF8String]); and usually it just works. But sometimes it does not and I get garbage like: ร่ว\340\270\241รส Converting these numbers to hex one

Re: printing Utf8

2012-10-31 Thread lbland
hi- On Oct 31, 2012, at 10:41 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSString *s = @ร่วมรส; Not supported. The compiler should be issuing a warning. You need to escape the characters using a UTF encoding. thanks!- -lance ___

Re: printing Utf8

2012-10-31 Thread Ken Thomases
On Oct 31, 2012, at 10:17 AM, lbland wrote: On Oct 31, 2012, at 10:41 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSString *s = @ร่วมรส; Not supported. The compiler should be issuing a warning. You need to escape the characters using a UTF encoding. That's not true. The

Re: printing Utf8

2012-10-31 Thread Vincent Habchi
Le 31 oct. 2012 à 16:17, lbland lbl...@vvi.com a écrit : hi- On Oct 31, 2012, at 10:41 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSString *s = @ร่วมรส; Not supported. The compiler should be issuing a warning. You need to escape the characters using a UTF encoding. I

Re: printing Utf8

2012-10-31 Thread Gerriet M. Denkmann
On 31 Oct 2012, at 22:15, Ken Thomases k...@codeweavers.com wrote: On Oct 31, 2012, at 9:41 AM, Gerriet M. Denkmann wrote: I print strings like: NSString *s = @ร่วมรส; fprintf(stderr, %s\n, [ s UTF8String]); and usually it just works. But sometimes it does not and I get

Re: printing Utf8

2012-10-31 Thread Jean-Daniel Dupas
Le 31 oct. 2012 à 16:31, Ken Thomases k...@codeweavers.com a écrit : On Oct 31, 2012, at 10:17 AM, lbland wrote: On Oct 31, 2012, at 10:41 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSString *s = @ร่วมรส; Not supported. The compiler should be issuing a warning. You need

Re: printing Utf8

2012-10-31 Thread Gerriet M. Denkmann
On 31 Oct 2012, at 22:15, Ken Thomases k...@codeweavers.com wrote: On Oct 31, 2012, at 9:41 AM, Gerriet M. Denkmann wrote: I print strings like: NSString *s = @ร่วมรส; fprintf(stderr, %s\n, [ s UTF8String]); and usually it just works. But sometimes it does not and I get

Re: printing Utf8

2012-10-31 Thread Ken Thomases
On Oct 31, 2012, at 2:42 PM, Gerriet M. Denkmann wrote: When I run this in Xcode for a few times, I get sometimes good output, but sometimes not. Bad output looks like: 2012-11-01 01:56:29.971 Writing[76838:303] strlen 1027

Re: printing Utf8

2012-10-31 Thread Fritz Anderson
I ran into something similar in my own work, but my solution may not fit your needs. printf() won't work reliably for you. My conjecture is that printf buffers its work byte-by-byte, and if an encoded character falls across a buffer boundary, the two parts are output as escaped-decimal,