Re: How to easily create a UTF-16 file?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Thunderbird 2.0.0.9 (Windows/20071031) Well, there's more question for the UTF-16 issue: I'm sure there's something different... but what's that? Really headache... Thanks. - Calvin Thanks for you guys. - Calvin On Feb 1, 2008, at 1:45 PM, Calvin Liu wrote: On Leopard, anyway: Terminal: % touch foo.txt % open -a /Applications/TextEdit.app foo.txt In TextEdit: Type stuff File: Save As... Plain Text Encoding: Unicode (UTF-16) Save Replace? Yes. -==- Jack Repenning Chief Technology Officer CollabNet, Inc. 8000 Marina Boulevard, Suite 600 Brisbane, California 94005 office: +1 650.228.2562 mobile: +1 408.835.8090 raindance: +1 877.326.2337, x844.7461 aim: jackrepenning skype: jrepenning _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/koifans%40shaw.ca This email sent to koifans@shaw.ca _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com I did all of these in order to create a UTF-16LE file. Yes I can do that with textedit but when I check that file with 'file' command, it says 'data', not 'Little-endian UTF-16 Unicode HTML document character data, with CRLF line terminators'. Both are UTF-16LE file, what's the difference between them? I attached the screen snapshot of hexeditor, for your reference. The utf-16-le-sample.png is the sample file which is detected as 'Little-endian' and utf-16-le.png is my file and is detected as 'data'. I also tried to add 'FF FE' in the head of my file, which is no help. And my file couldn't be open correctly in safari. (Nowhere to set utf-16 in safari!) Firefox is ok but in Firefox 2 I need to manually set the encoding to utf-16le, which is not necessary for the sample file. Calvin Liu wrote: OK, now I know what the problem is -- need to set options in preferences of textedit. So I can create and save the file to any available encoding. Jack Repenning wrote: Actually I tried. I didn't find that option in TextEdit for creating/saving a file.
participants (1)
-
Calvin Liu