Connecting Tech Pros Worldwide Help | Site Map

Charsets!

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:08 AM
mrT
Guest
 
Posts: n/a
Default Charsets!

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, 01:09 AM
Boyd
Guest
 
Posts: n/a
Default 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/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.