paolodona.com

I'm an Italian web developer and (almost) entrepreneur based in London.

File Encoding Conversion

This morning I struggled a bit to find a decent encoding converter for osx… from time to time I get stuck on encoding issues so I wanted to have something ‘friendly’ to handle this kind of problems…

I found Cyclone based on Apple Text Encoding Converter (look for TEC) but it kept failing in some strange ways (It gave me weird messages about converters creation). After googling for a while I gave up. It seems there are no good-free-GUI alternatives on the net…

Sometimes the solution is closer than you think and the good old iconv rescued me in a snap:

[paolofingus]$ iconv -f UTF-16 -t UTF-8 utf16_file.txt > utf8_file.txt@

you can list the available encodings with:

[paolofingus]$ iconv -l@

The cool part is you can use it in conjunction with TextMate’s Filter Through Command feature thus enabling in-editor lightning-fast conversions.

The only missing part was discovering the original file’s encoding, in order to pass iconv the correct -f option. The not-so-reliable way I used was to open the file with Firefox and inspect the encoding using the View → Character Encoding menu item.

That’s it, problem solved.
If you know better ways to do this… let me know!

published on Feb 27, 2008 by Paolo Dona

Other Articles:

Two Tips To Reduce Eye Strain » Why My Previous Business Didn't Work » Replace New Year's resolution with 12 monthly resolutions » A bunch of new books » Back to a proper Blog » File Encoding Conversion » To my email driven friends » or visit the archive

Contacts:

paolo.dona@gmail.com

My stuff:

Curriculum Vitae

Current bookshelf

Open source projects

YouTube channel

My photo gallery

Keep in touch!

My RSS Feed
Follow me on Twitter

In Rotterdam

When I Was a Rock Star

Pineapple field in Hawaii

RailsConf07 Speech