Jump to content

Charset ISO


Spunky

Recommended Posts

Ok, so I've decided to start testing using foreign characters, particularly Japanese, and I am a little confused on something. For a test to make sure it works, I made a new XHTML file, changed the charset to ISO-2022-JP and put a Japanese character in the body, and yay, it works. It even changes the font of the XHTML code, which is weird. So now I want to apply using it in a personal program so to speak that I am working on. Right now I have the Japanese characters in an image and then displayed that way. But when I change the charset, nothing happens. The font doesn't get all weird, and the letters don't display correctly. Is there something I need to do to make a precreated XHTML file display foreign characters?

Link to comment
Share on other sites

When an (X)HTML file is served from a web server, its HTTP headers override any meta elements in the file. Your new file probably worked because you were running it from the file system, not from a web server. Once you were taking the file from the web server, the charset specified by the headers (i.e. the default charset) took priority over your meta element.Instead of trying to get your document to work with ISO-2022-JP, I'd highly recommend you try to use UTF-8 though. It's one of few charsets that can contain any Unicode character, and the most widely supported such charset.

Link to comment
Share on other sites

Both web pages are run from my computer. Just using XHTML and JavaScript. They are personal projects so I don't have them on a web server. Also, UTF-8 is the default that Dreamweaver puts in. When I tried having the page show a Japanese character, it did not properly. For instance if I put in the hirigana symbol for 'a', it would just show an 'a' with some sort of accent mark and a comma after it. Or is there something else that I need to do to display foreign characters?

Link to comment
Share on other sites

The file itself also needs to be saved as UTF-8. Open the file with Notepad, click "Save As...", and make sure "Encoding" is UTF-8. Then reload it with Dreamwaver (from now on, Dreamwaver should save the file as UTF-8; it has an option equivalent to Notepad's encoding one, but it's berried in some menus).

Link to comment
Share on other sites

Hmm, that worked. Weird, you would think that Dreamweaver would save it as UTF-8 by default? Thank you so much. I had just never known much about displaying foreign characters so when I was doing a search I could only find stuff about ISO.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...