Connecting Tech Pros Worldwide Help | Site Map

Charsets!

  #1  
Old July 17th, 2005, 02:08 AM
mrT
Guest
 
Posts: n/a
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!
  #2  
Old July 17th, 2005, 02:09 AM
Boyd
Guest
 
Posts: n/a

re: Charsets!


In article <1430249e.0311150341.38f8727d@posting.google.com >,
google@atomz.cjb.net says...
[color=blue]
> I want PHP to convert those back into their 'real' characters. That
> ★ one becomes ?, for example, which is a star symbol under
> Shift-JIS.[/color]


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/
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
'c:\mysql\share\charsets\?.conf' error dave answers 0 April 17th, 2006 06:55 PM
Multiple charsets in same table? Rasmus Rimestad answers 0 July 20th, 2005 01:27 AM
How can I find out the charsets supported by my DB? Francesco Moi answers 0 July 20th, 2005 12:37 AM
Eclipse for Linux: Missing charsets in String to FontSet conversion Tux answers 0 July 17th, 2005 11:48 PM