Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Unicode to UTF8? Can it be scripted? ciscoforum msg:1531852 1:37 pm on Oct 11, 2005 (gmt 0) Hey
Just wondering if anyone has any tools for converting a text file from unicode to utf8? I've been doing it with notepad but i'd like a more automated solution.
Alternative Future msg:1531853 1:41 pm on Oct 11, 2005 (gmt 0)
native2ascii [ google.com] you can do the following:
1 - Open the original file in Notepad. Make any necessary changes, then Save As, Unicode.
2 - Using Ultra Edit or similar, convert the file to UTF-8 (Unicode to UTF8, Unicode Editing)
3 - Use the java tool native2ascii to convert the file using the following command (from Command Prompt):
4 - native2ascii -encoding UTF8 [source file] [destination file]
e.g.native2ascii -encoding UTF8 D:\work\yourfile.ext
ciscoforum msg:1531854 2:00 am on Oct 12, 2005 (gmt 0)
Thanks for that.
Tried native2ascii but it just turned it into a huge mess.
bird msg:1531855 9:12 am on Oct 12, 2005 (gmt 0)
First you need to figure out what encoding your file really is written in.
"Unicode" is not an encoding for file data, it's just a numbering system for characters. UTF-8 is one of several possible ways to encode unicode data for storage in files. Other popular ones are UTF-16 and UTF-32, both of which exist in big-endian and little-endian versions.
As long as you just know "unicode", your guess is as good as mine about the actual contents of the file, and the best way to convert it.
ciscoforum msg:1531856 10:34 am on Oct 12, 2005 (gmt 0)
The file is currently UTF-32