Re: How to easily create a UTF-16 file?
Re: How to easily create a UTF-16 file?
- Subject: Re: How to easily create a UTF-16 file?
- From: Calvin Liu <email@hidden>
- Date: Fri, 01 Feb 2008 15:39:50 -0800
Well, there's more question for the UTF-16 issue:
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.
I'm sure there's something different... but what's that? Really headache...
Thanks.
- Calvin
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.
Thanks for you guys.
- Calvin
Jack Repenning wrote:
On Feb 1, 2008, at 1:45 PM, Calvin Liu wrote:
Actually I tried. I didn't find that option in TextEdit for
creating/saving a file.
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden