discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting UTF-8 value of string occasionally fails


From: Christopher Culver
Subject: Getting UTF-8 value of string occasionally fails
Date: Wed, 13 Oct 2004 04:11:30 -0500 (CDT)

In developing Charmap I have encountered several Unicode positions
where getting calling -UTF8String on a string consisting solely of
that position's character results in:

"Uncaught exception NSCharacterConversionException, reason: Can't get
UTF8 from Unicode string."

Even clicking on Ignore crashes the application.

An example is U+D800 <Non Private Use High Surrogate, First>. I would
ask anyone interested in this problem to update Charmap from
CVS. Launch it, open the Character Inspector and select the block High
Surrogates. Watch the exception panel pop up. The exception is caused
when the inspector tries to display various representations, for which
in my implementation it is necessary to get its UTF-8 value.

Should U+D800 return a valid UTF-8 string? Is this a bug in base or
correct behavior?

If it's my fault, suggestions for a workaround would be appreciated.

Christopher Culver

p.s. Charmap CVS has a lot of new functionality and little crashiness,
I'd encourage all to check it out.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]