This is a discussion on Charsets! within the PHP Language forums, part of the PHP Programming Forums category; Without any experience outside of regular European / Unicode charsets, I'm a bit stuck with a PHP app that needs ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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! |
|
|||
|
In article <1430249e.0311150341.38f8727d@posting.google.com >,
google@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/ |