Utf-8 or utf8

I often get this message after pasting something into my code editor…really bugs me searching through it and replacing all the bits that I think are causing the issue (sometimes I just can’t find them and give-up).

This file contains characters that cannot be saved with the ASCII text encoding. You can save the file with the UTF8 encoding and include the following meta tag for browsers to read:
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”>

Do you want to use the UTF8 encoding to save this file?

Does it really matter if I use utf8 rather that utf-8, and if so why?

Thanks, Karl.

Good advice ralph, I’ll remember that! :wink:


Thanks for the reply noonnope.

1). I use Tach HTML Editor, works for me as I love it’s instant preview.
2). Often I just throw my rattle out of my pram and save as uft8.
3). I mostly just slowly go through my text looking for things like ’ " etc… 70% of the time replacing them with code sorts it.
4). Help! :slight_smile:

I think I’ll take Ralph’s advice for starters. I’m seriously thinking about using HTML5 as default with the utf-8 charset (took John Allsopp’s HTML5 course). What do I need to avoid and what is good practice.

Unfortunately, Taco HTML Edit is not HTML5 friendly at the moment…doesn’t colour code nor validate HTML5 at present which is a real pain. I hope they sort it soon as it would be a shame to have to drop it for another…got all my code clips in it’s manager too. :frowning:


’ " are valid ascii chars, so these are not the problem.

i think you need to learn about the differences between:

  • placing a command that describes the content as being utf8:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

in a file that’s ascii encoded, which alone will not permit you to put utf8 content in it

  • saving a file with utf8 encoding which permits you to place such content in a file :slight_smile:

first, what code editor you’re about?

second, there are differences between ascii and utf-8. big. in the example above utf-8 it’s a constant/value for an attribute, so yes, it matters if you write a constant value correct. it matters if you use utf8 instead, which is not a valid constant value.

third, a search and replace … of what with what?

it all cuts down to specific if you want help :slight_smile:

In the actual code, use utf-8, as is suggested. I never paste anything from Word (and similar programs) straight into my code. I paste it into a simple code editor (such as TextEdit or NotePad) which is set to utf-8 encoding. Then I paste into my code. I never get any warnings like you are reporting.