Practical advice on how to work with UTF-8 files |
Practical advice on how to work with UTF-8 files |
Christian J |
Dec 15 2015, 05:16 PM
Post
#1
|
. Group: WDG Moderators Posts: 9,663 Joined: 10-August 06 Member No.: 7 |
Those of you that use UTF-8, what does your workflow look like when creating new HTML files?
I suspect I'll keep forgetting to save new files as UTF-8 in my text editor. When that happens, how can you easily tell if a file was saved as UTF-8 or ANSI (especially if it was saved as UTF-8 without a BOM)? Do you have to look in your text editor's document properties? What if you forget to check, and the web page doesn't contain many exotic characters that may alert you of your mistake? (I'm thinking of switching to UTF-8 just to please the W3C validator: http://forums.htmlhelp.com/index.php?s=&am...st&p=114090 but otherwise I don't really need it, and fear it will just cause problems.) |
Christian J |
May 14 2017, 12:07 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,663 Joined: 10-August 06 Member No.: 7 |
Did some more tests. This makes my head spin, so maybe I got it wrong again.
TextPad's Preferences let you specify different default encodings for various document classes, but it seems the default for text documents affects other document classes too. In other words, UTF-8 as default for text documents will also apply to new documents saved as HTML --TextPad's default for HTML documents has no effect. Furthermore, if you explicitly specify a non-default encoding when saving an HTML document, TextPad obeys you even if you use the wrong META charset (and characters like "å ä ö" are consequently garbled). Apparently TextPad encodes text differently depending on the META charset. When you open such a document in TextPad, it again seems TextPad lets the META charset decide the encoding: - A document with <meta charset="UTF-8"> can be explicitly saved as ANSI (which turns "å ä ö" into "? ? ?"), but when you open it again TextPad considers it UTF-8. - A document with <meta charset="iso-8859-1"> can be explicitly saved as UTF-8 (which turns "å ä ö" into "Ã¥ ä ö"), but when you open it again TextPad considers it ANSI. |
pandy |
May 14 2017, 05:07 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
Never used TextPad, so can't be of much help I'm afraid.
|
Lo-Fi Version | Time is now: 4th May 2024 - 03:21 PM |