Re: utf8 to NSString crasher

2008-09-03 Thread Waqar Malik
Thanks every body for all the help. The issued turned out to the invalid wchar_t string so NSString is returning nil. If NSString can't convert the whole string it returns nil. --Waqar ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: utf8 to NSString crasher

2008-09-03 Thread Michael Ash
On Tue, Sep 2, 2008 at 10:29 PM, Waqar Malik <[EMAIL PROTECTED]> wrote: > Is there a canonical way to convert wchat_t to NSString? There isn't, because there is essentially no canonical wchar_t. The only requirements for wchar_t is that it be at least 8 bits wide and that it be compatible with th

Re: utf8 to NSString crasher

2008-09-03 Thread Shawn Erickson
On Tue, Sep 2, 2008 at 8:07 PM, Waqar Malik <[EMAIL PROTECTED]> wrote: > Well I really want to convert wchar_t to NSString, and the only way to > convert to NSString was to convert to UTF8 apparently wchar_t->utf8 is > converting correctly. Who is creating the wchar_t strings? What encoding is be

Re: utf8 to NSString crasher

2008-09-02 Thread Ken Thomases
On Sep 2, 2008, at 9:42 PM, Clark Cox wrote: On Tue, Sep 2, 2008 at 7:29 PM, Waqar Malik <[EMAIL PROTECTED]> wrote: I am converting UTF8 string "Rø" to NSString using stringWithUTF8String: I get nil as a return value: (gdb) p utf8_str $1 = "R\303", '\000' That is not a valid UTF-8 string

Re: utf8 to NSString crasher

2008-09-02 Thread Clark Cox
On Tue, Sep 2, 2008 at 7:29 PM, Waqar Malik <[EMAIL PROTECTED]> wrote: > I am converting UTF8 string "Rø" to NSString using stringWithUTF8String: I > get nil as a return value: > > (gdb) p utf8_str > $1 = "R\303", '\000' That is not a valid UTF-8 string. The UTF-8 encoding of "Rø" would be "R\303

utf8 to NSString crasher

2008-09-02 Thread Waqar Malik
I am converting UTF8 string "Rø" to NSString using stringWithUTF8String: I get nil as a return value: (gdb) p utf8_str $1 = "R\303", '\000' (gdb) po theString Cannot access memory at address 0x0 Is there a canonical way to convert wchat_t to NSString? Thanks --Waqar__