Forum Moderators: coopster
I've just discovered that I'm having quite a big problem.
For years, I've designed Japanese websites with the SHIFT-JIS encoding. Yesterday, on a new project, I've noticed that certain Japanese characters went wrong. After a search, I found the explanation on PHP.net basically saying : "The shift_jis character set includes a number of two-byte code characters that contain the hex-value 0x5c (backslash) which will get stripped by this function thus garbling those characters."
Since I have to continue to use stripslashes(), I have no choice but use a different encoding. I then decided to use : content="text/html; charset=EUC-JP".
The problem is that I get a blank page on IE and fully garbled text on Firefox.
I forgot to do something but what?
Thanks for helping! :)
I have never met anyone who recommended EUC-JP encoding. It was a problematic encoding back in the early web days and I've kept away from it myself. Is UTF-8 an option?
From what I read everywhere, UTF-8 is problematic as well and the majority of Japanese websites are either shift-ji s or euc-jp. That's why I did choose euc-jp.
Anyway, I've just posted on a Japanese website and I've been told that I simply have to convert the files to the new encoding with the help of a freeware that I've installed now
I'll see how it goes.
[edited by: bill at 5:20 am (utc) on April 21, 2006]
[edit reason] snipped URLs [/edit]
Also, just for curiosity, I had a look at the encodings of sites of major Japanese companies such as NTT and Sony and they all use Shift-Jis ... which makes me think that perhaps, I'm heading toward the wrong direction.
Maybe I should continue with shift-jis and do something about that stripslashes() function that is currently bothering me.
I admit I've never really fully understood the whole concept of addslashes() and stripslashes(). I know that slashes need to be added during record insertions of special characters in the database. But due to the fact that get_magic_quotes_gpc is on, slashes are applied to any posted data ... and I'm hesitating : should I turn it off and use a function that would add slashes only on specific targeted characters only during database insertions?
As you can see, I'm very confused ;(
I'd be grateful to anyone who would care to give some helpful hint.
I would think there would be some out there.
I worked some with a chinese website that encountered similar problems. They created custom functions for stripping/adding slashes. I didn't really have much to do with it so I can't really suggest any code.
anyone else have any input?