Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Japanese encoding--from php files vs from database


Recommended Posts

I'm using the Japanese language pack which uses the EUC-JP encoding for the Japanese characters. This all works great, as most of the information is stored in php files in the EUC-JP encoding. However, when i enter my products, which are stored in the database, I cannot get the characters to display correctly with the rest of the store. I've tried EUC-JP character encoding and pasting that into the text field for the product, saving it to the database, then viewing it in the browser, and its garbled. If I use Shift_JIS and I switch the browser to Shift_JIS the product information looks fine but then the rest of the store is garbled because its in EUC-JP. No matter what I try I can not get both to work at the same time and under EUC-JP. Hopefully, my rambling above will make sense to someone and they can provide a solution to this problem.


Thanks in advance to any help!

Link to comment
Share on other sites

  • 2 months later...

I don't know what I'm doing either, and I'm still struggling with my email headers coming out correctly. But, I have been operating a Japanese website for the last year using the MS1 version from tep-j website (see Japanese support site), and have recently switched over to MS2 and have it working to some degree (see http://asatsuru.com). At any rate, it seems the easiest to edit your files that have EUC-JP encoding through a browser-based editor. The main reason being is that most Windows machines, even in Japan, have Shift_JIS as default, and fighting with MS is mostly fruitless. I use an open source editor called JEDIT for the php and html files (also has a pretty good diff plug-in) and it will check your code for errors. But in entering products through the OSC admin interface, you should (and we do) enter and edit direct. The only trick maybe that you have to have your browser set to EUC encoding. FYI, we are using English version WinXPpro on American machines that we brought over. They are "out of the box" and only have Asian language support enabled, nothing special, nothing added. We are using IE6 and have ULTRA HTML 1.7 installed.

The phpAdmin tool is capable of EUC-JP and should be set to EUC if you are editing text for Japanese. One other ting you may need to be aware of is that when you input in one encoding, it may not always be saved in that encoding. And my FTP agent, for example, is notorious for scrambling code on up load, so the ultimate best way to edit is still through the browser manually set to the correct encoding.

Sorry if it's not much help. I'm still a beginner, too.

Link to comment
Share on other sites


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

  • Create New...