On Tue, Apr 28, 2009 at 12:26 AM, Erg Consultant
<erg_consult...@yahoo.com> wrote:
> One other thing I should mention - the mangled char in question is the tm 
> symbol (option-2). In its string form, the debugger shows it as the tm char.
>
> But when I convert the string to an NSURL using fileURLWithPath, and then do 
> a CFShow, the tm is converted to *three* hex chars:
>
> %E2%84%A2
>
> Are NSURL and CFURL not toll-free bridged?

Read this:

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

And then this:

http://en.wikipedia.org/wiki/UTF-8

And this:

http://en.wikipedia.org/wiki/UTF-16

Then, suitably enlightened, come back and fix up your code to work
with your new knowledge.

One other piece of knowledge: if you're converting your std::string to
an NSString by writing it to a file, you're doing it wrong. Very,
very, very wrong. All you should have to do is [NSString
stringWithCString:stl_string.c_str() encoding:...] with the
appropriate encoding substituted at the end. If you do not know the
appropriate encoding, then you must find out. If the encoding is not
UTF-8, then I strongly encourage you to make whatever changes are
necessary so that it *is* UTF-8, as UTF-8 is the only sensible 8-bit
encoding to use these days unless you're communicating with legacy
systems.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to