473,395 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Charsets!

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
1 1743
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tux | last post by:
I use Mandrake 9.1 and Eclipse works just fine but there is a warning that I don't know what that mean and how to fix it: Missing charsets in String to FontSet conversion
0
by: mikeswk | last post by:
Hi, all I'm using jsp to connect to mysql 3.23.44 max using connector 3.0.6 (default charset=latin1) I'm trying to put some multi-byte characters (for example big5) together with latin...
0
by: Francesco Moi | last post by:
Hello. I want to find out the charsets supported by DataBase. I tried "SHOW CHARACTER SET" but I get this error: --------------- mysql> SHOW CHARACTER SET; ERROR 1064: You have an error in...
0
by: Rasmus Rimestad | last post by:
Hello! I have developed an internet application in PHP/mySQL which is now getting internationalised and will start to contain information from contries like Poland, Hungary, Czech Republic etc....
0
by: Wouter | last post by:
I use phpMyAdmin. All queries there work. But when I do the same query with PHP with the same user I get: 1267 - Illegal mix of collations (latin2_general_ci,IMPLICIT) and...
1
by: vKp | last post by:
I have a bunch of XML documents that are in the ISO-8859-1 character set. I want to convert them all to UTF-8. How can this be done? Are there any tools for it? Thanks
0
by: dave | last post by:
I am trying to resolve the following mysql error: File 'c:\mysql\share\charsets\?.conf' not found (Errcode: 22) Character set '#33' is not a compiled character set and is not specified in the ...
0
by: jose | last post by:
I use the WinHttp.WinHttpRequest.5.1 object from a asp .net page to get the content of another asp .net page. I set a cookie in the object. The value of that cookie is 'adf'. But the cookie is...
0
by: jose | last post by:
I use the WinHttp.WinHttpRequest.5.1 object from a asp .net page to get the content of another asp .net page. I set a cookie in the object. The value of that cookie is 'adf'. But the cookie is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.