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, because
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
> หหห
On 31 Oct 2012, at 22:15, Ken Thomases 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 garbage
Le 31 oct. 2012 à 16:31, Ken Thomases a écrit :
> On Oct 31, 2012, at 10:17 AM, lbland wrote:
>
>> On Oct 31, 2012, at 10:41 AM, "Gerriet M. Denkmann"
>> wrote:
>>
>>> NSString *s = @"ร่วมรส";
>>
>> Not supported. The compiler should be issuing a warning. You need to escape
>> the char
On 31 Oct 2012, at 22:15, Ken Thomases 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 garbage
Le 31 oct. 2012 à 16:17, lbland a écrit :
> hi-
>
> On Oct 31, 2012, at 10:41 AM, "Gerriet M. Denkmann"
> wrote:
>
>> NSString *s = @"ร่วมรส";
>
> Not supported. The compiler should be issuing a warning. You need to escape
> the characters using a UTF encoding.
I never had any problem
On Oct 31, 2012, at 10:17 AM, lbland wrote:
> On Oct 31, 2012, at 10:41 AM, "Gerriet M. Denkmann"
> 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 compiler
hi-
On Oct 31, 2012, at 10:41 AM, "Gerriet M. Denkmann"
wrote:
> NSString *s = @"ร่วมรส";
Not supported. The compiler should be issuing a warning. You need to escape the
characters using a UTF encoding.
thanks!-
-lance
___
Cocoa-dev maili
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 t