HartleySan Posted March 25, 2011 Share Posted March 25, 2011 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 More sharing options...
Paul Swanson Posted March 25, 2011 Share Posted March 25, 2011 I haven't worked with Japanese, but did a Google search and the first two hits implied that JIS is preferable to Shift-jis when displayed in a browser. About.com's article JREF's article Hope that helps ... 1 Link to comment Share on other sites More sharing options...
Jonathon Posted March 25, 2011 Share Posted March 25, 2011 What happens if you change the charset=utf-8 or charset=euc-jp? 1 Link to comment Share on other sites More sharing options...
HartleySan Posted March 26, 2011 Author Share Posted March 26, 2011 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 More sharing options...
Recommended Posts