homepage Welcome to WebmasterWorld Guest from 54.167.75.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Character set
Black diamond
Adam5000




msg:4322331
 12:15 am on Jun 6, 2011 (gmt 0)

Greetings all

For my web pages I'm currently using the character set iso-8859-1 and I'd like to change it to the UTF-8 character set.

I'm currently using the meta tag <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

The problem is when I change the meta tag to <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> the copyright symbol turns into a black diamond with a question mark in it.

The symbol was copied and pasted into the pages from the character map that came with Windows 7. start menu/all programs/accessories/system tools folder.

Help!

 

lucy24




msg:4322354
 2:01 am on Jun 6, 2011 (gmt 0)

You can't simply change the meta tag. The file itself has to be changed concurrently from Latin-1 to UTF-8. How you do this depends on the editor, so I can't give detailed instructions. If you are on Windows, it probably involves something more complicated than changing a popup.

Currently your browser is trying to interpret Latin-1 text as UTF-8. This will not work-- especially if that Latin-1 is really Windows-Latin-1 (a superset of ISO-Latin-1). Some Latin-1 characters will simply come through as the wrong letter; others won't display at all. The angry black diamond is the "I can't deal with this" UTF-8 character, FFFD.

Oh yes and... You will also need to take a precautionary look at your uploading program-- FTP or whatever it is-- to make sure it isn't making the wrong assumptions about file encoding. For example, earlier versions of Fetch changed all my text files (for FTP purposes, "text" includes HTML) into Mac encoding. I don't remember if I changed a setting or if it simply learned to read the meta tag.

Leosghost




msg:4322358
 2:39 am on Jun 6, 2011 (gmt 0)

Try...&#169; ( which is the html character and may save you converting everything ..but it would be better if you did as Lucy says and did all of it ;-) ..in which case.

You might find [macchiato.com...] this handy, and this [unicode.org...] and this, [unicodetools.com...] and search for "ASCII and UTF-8 Table"

And if you are looking for a free editor that will convert from one to the other and runs on windows7 etc

[editpadlite.com...]

[babelstone.co.uk...]

or

[pspad.com...]

And if you want to pay and want the best..editpadpro ..which many of us here will recommend for use on windows ..and it runs on linux under wine

rocknbil




msg:4322529
 4:33 pm on Jun 6, 2011 (gmt 0)

Or &copy;, HTML entities can help under many conditions. You've probably seen this but a good document to bookmark: Character encoding, entity references and UTF-8 [webmasterworld.com].

lucy24




msg:4322655
 11:03 pm on Jun 6, 2011 (gmt 0)

File and Remember:

If you use entities for all non-ASCII characters, it does not matter what encoding you declare. The term "charset" is misleading (boring historical reason which I won't go into, mainly because I don't remember it). It has nothing to do with what characters the document is able to display; it only refers to the relationship between the raw HTML file and what the user sees. Any HTML file can display any character.

To make things more fun, there are three ways to do entities. First are the HTML 4 named entities: &eacute; and so on. Long long ago when I used Internet Exploder 5.1 (the last Mac version), it was only able to display characters that had a named entity. You didn't have to use the entity-- you could use numbers or the actual character-- but it had to have one. (And it couldn't read the "charset" declaration, so you had to change that manually. I still include a blurb about it in all e-texts, though by now it's probably superfluous.)

Then there are the decimal numerical entities. My fingers do not like typing the word "entitities". Like "banana", they do not know where to stop. &#233; for that same , for a savings of two bytes-- set against an even higher level of unreadability in the raw file. And finally the hexadecimal entities &#xE9; Doesn't save any space unless you get into big numbers where powers of 16 use fewer digits than powers of 10, but useful if your character map is hexadecimal to start with.

Now back to the original post. Just out of curiosity, why did you want to change encodings? Personally I use UTF-8 by default, but then I use a lot of non-ASCII and especially non-Latin-1 characters ;)

Adam5000




msg:4322861
 12:02 pm on Jun 7, 2011 (gmt 0)

Thanks everyone

I'm using notepad for an HTML editor and I wanted to change to UTF-8 because I thought 8859-1 was becoming obsolete.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved