Jump to content
Larry Ullman's Book Forums

Recommended Posts

Not sure if there are any experts on the topic, but I'm simply trying to load Japanese text from a text file and print it to the screen, but something is obviously wrong with the encoding/charset. I really am at a loss with this sort of thing.

 

Basically, the file is save with Shift JIS encoding (and the text looks fine in the file), so I tried setting the following meta tag and then outputting the data, but it comes back all garbled:

 

<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">

 

If anyone could show me the error of my ways, I would be most appreciative.

Link to comment
Share on other sites

I honestly have no idea what is going on, as I'm grabbing HTML from an external HTML page that is clearly marked as Shift JIS, but when I use that encoding and output the HTML to my page, it's all garbled.

 

The real kicker though is that if I use some sort of regex to grab a piece/pieces of data from the external HTML, and output that regex-processed data to the screen, even though the content is in Japanese, it displays perfectly fine.

 

I am truly confused.

Link to comment
Share on other sites

 Share

×
×
  • Create New...