

If your editor does that, “use a different editor”-seriously! If your problem is that your editor is loading files that don't contain £ or any other non-ASCII character as UTF-8, causing any new £ you add to them to be saved as UTF-8 afterwards, then again, simply adding a £ character on its own to the top of the file should certainly stop that. So no editor should open any such file as UTF-8 if it did, it'd lose the £ completely. (You could guard against that by putting a £ on its own at the top of the file.) a single byte 0xA3), that's not going to form part of a valid UTF-8 byte sequence, unless you're unlucky and it comes right after another top-bit-set character in such a way to make them work together as a UTF-8 sequence. Normally, if you have a £ encoded as ISO-8859-1 (ie. Please don't say "use a different editor" because I'm an old fart and set in my ways :-) Unicode advocates / evangelists needn't waste their time trying to convert me because I'm already one of them! This is a rickety older system I've inherited :-(

So, are there any sort of character hacks - like I mention above - to do this? Or any other methods? Don't get me wrong, I can fix the file and save it out again as ISO-8859-1, but I want it to always open as ISO-8859-1 in my editor. This isn't normally a problem EXCEPT for pound (£) symbols and whatnot. I've got some files that MUST be ISO-8859-1 but keep opening in my editor (Bluefish 1.0.7 on Linux) as UTF-8. I remember this because now I have a similar, albeit Anglophone, problem. What they did was to put a comment at the top of the file containing a Japanese character that only existed in that particular character encoding - it wasn't in any of the others! This worked perfectly. I remember when I used to develop website in Japan - where there are three different character encodings in currency - the developers had a trick to "force" the encoding of a source file so it would always open in their IDEs in the correct encoding.
