Convert ANSI text files to UTF-8

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,479
44
Albuquerque, NM
prospero.unm.edu
#1
Code:
for %f in ( *.txt ) tpipe /input="%f" /output="%@name[%f].utf8" /unicode=ansi,utf-8 /string=1,0,\xef\xbb\xbf
This example adds a UTF-8 byte order mark. If you don't want the BOM, omit the /STRING= option. (The last argument to /STRING appears to be a string of bytes, not characters. If you use the intuitive \xFEFF, you'll get gribble at the start of the file.)
 
Feb 23, 2012
238
3
#2
This example adds a UTF-8 byte order mark. If you don't want the BOM, omit the /STRING= option. (The last argument to /STRING appears to be a string of bytes, not characters. If you use the intuitive \xFEFF, you'll get gribble at the start of the file.)
Great stuff! Thanks for posting, Charles. The BOM issue is always a delicate one with UTF-8, and it's good to learn that with TPIPE we can keep it under control.