[ILUG] Editing ISO8859-15 (Windows) encoded text files

Jimmy O'Regan joregan at gmail.com
Wed Jul 9 02:05:08 IST 2008


2008/7/9 David Golden <david.golden at unison.ie>:
> On Wednesday 09 July 2008, John Honan wrote:
>
>> fine (I'm pretty sure these files are saved with ISO8859-15 encoding)
>>
>> I recently attempted to edit a file from within Mandriva 2008.1 and
>> hit all sorts of problems. I FTP'd the file using Filezilla and
>> opened it in vim, but all the euro symbols were converted into '<80>'
>> in blue text. So, I replaced these characters with euro symbols, but
>> then vim wouldn't let me save the file (something about a dos
>> conversion error)
>
>> Questions; Why does something as powerful as vim have a problem with
>> these ISO8859-15 encoded files? Why can't it autodetect the encoding?
>
> Well, if they originated on a windows system, they may not actually
> be iso8859-15, they might e.g. be the horrible microsoft cp-1252 , a
> microsoft-mangled variant of iso8859.   That can be tricky to
> autodetect, especially since microsoft (and windoze-monkey produced in
> general) tools have a habit of mislabelling it.  This is quite normal
> standard-corrupting behaviour for microsoft.
>
> Giveaway: Euro sign is #x80 in cp1252.  Euro sign is #xA4 in iso8859-15
>

Just a nitpick: the Euro sign as #x80 gives away that it's a windows
codepage file, but not necessarily 1252 - the Euro sign is the same in
125[0-9] (though 1252 is the most reasonable guess for this region :)



More information about the ILUG mailing list