By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

Charsets!

P: n/a
mrT
Without any experience outside of regular European / Unicode charsets,
I'm a bit stuck with a PHP app that needs to be able to handle foreign
characters.

I've got the content-type header working, but I'm not sure how to
handle the special numerical representations for characters that are
submitted by text forms under some conditions (when the charset is not
correct for the system or something)... like ★ for example.

I want PHP to convert those back into their 'real' characters. That
★ one becomes , for example, which is a star symbol under
Shift-JIS.

I can't find anything in the manual to help, but maybe I'm not looking
in the right place. I would appreciate any help with this, and any
ideas for places to go for general charset info, so I can master this
thing!

TIA!
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <14**************************@posting.google.com >,
go****@atomz.cjb.net says...
I want PHP to convert those back into their 'real' characters. That
★ one becomes ?, for example, which is a star symbol under
Shift-JIS.

function convert_htmlspecialchars ($string) {
$trans_table = get_html_translation_table (HTML_SPECIALCHARS);
$trans_table = array_flip($trans_table);
return strtr($string, $trans_table);
}
--
**************************************
The Eldritch Dark:
Dedicated to Clark Ashton Smith
http://www.eldritchdark.com/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.