Welcome to WebmasterWorld Guest from 50.19.160.72

Forum Moderators: open

Message Too Old, No Replies

Unicode to UTF8?

Can it be scripted?

     
1:37 pm on Oct 11, 2005 (gmt 0)

New User

10+ Year Member

joined:Sept 27, 2005
posts:33
votes: 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.

Cheers
Brad

1:41 pm on Oct 11, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 22, 2003
posts:1022
votes: 0


Hello ciscoforum,

Using 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

HTH,

-Gs

2:00 am on Oct 12, 2005 (gmt 0)

New User

10+ Year Member

joined:Sept 27, 2005
posts:33
votes: 0


Thanks for that.

Tried native2ascii but it just turned it into a huge mess.

Thanks anyway.

9:12 am on Oct 12, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 10, 2001
posts:1550
votes: 10


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.

10:34 am on Oct 12, 2005 (gmt 0)

New User

10+ Year Member

joined:Sept 27, 2005
posts:33
votes: 0


O sorry

The file is currently UTF-32

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members