On 12 Mar '08, at 9:40 PM, S.J.Chun wrote:
For example, a file in zip archive from Windows(Korean), the file namewill have CP949 encoding. If I unzip this file the file name looks weird asyou already expected. How can I repair the name of file?
That depends on what the un-zip program did. It sounds like it read the filename from the zip archive using the wrong encoding. I would guess that the most likely encoding it used was CP-1252, aka WinLatin, a superset of ISO-Latin-1. In other words, it read the bytes of the filename in the archive, used a CP-1252 decoder to convert them into Unicode characters, and then converted those to UTF-8 to pass to the Mac filesystem APIs.
So to fix this you'd need to do the reverse: Read the filename, convert to Unicode if necessary (already done for you if you're using Foundation APIs that return NSStrings), then encode the Unicode into CP-1252. Now you have the original bytes as they were in the zip archive. Decode them using CP949, and use the resulting Unicode as the new filename.
—Jens
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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 [EMAIL PROTECTED]