Forum Moderators: open
I have a forum, phpBB running on a mysql database. Due to the nature of the forum we have a fair number of posts that use Chinese Characters. Occasionally they didn't display properly, but since a recent switch to UTF-8 encoding, they've all been fine.
I have a 'topics anywhere' modification added. This allows me to produce a piece of javascript, which I then place in another, off-site page, or give to someone else.
Everytime this javascript is run, it runs a (php) script hosted on my server, which queries the database and passes back a list of the latest topics - which are printed to the page in question. This acts as a good advert for my site, and a little bit of free dynamic content for the guy or gal hosting it.
However, when the topic titles are printed, any Chinese Characters do NOT display properly.
This is not a problem with my forum - we have no trouble with the same titles. It's not a problem with the pages in question, as other Chinese characters display fine, and I've tried switching the encoding around.
So, I've concluded that the javascript does not like Chinese characters.
Any idea on how I could solve this without having to redo the whole system to not use js? I've done the usual searches, but with no joy.
Roddy
A unicode character looks like: \u#####
And so... I haven't converted from utf-8 to unicode ever, but what you will have to figure out is what the unicode representation of each character you are trying to print is.
UTF-8 is a transformation of unicode, so it should be rather straightfoward, if not requiring a bit of research.
Am I on the riht track with what you are looking for? I'm not sure.
I don't think a manual solution will work. As the output of the script changes according to what the most recent topics are, I can't predict what characters will be needed.
I'd really like to find a solution for this, as the random garbage thrown up occasionally is causing people to take the scripts off their sites (understandably), which results in me losing great links . . .
Roddy