Please try to use this function if you have a problem to convert charset iso-8859-11 to UTF-8. This function I use convert Thai font (iso-8859-11) to UTF-8. If ($tbytes) return false // incomplete sequence at EOS If (!($aCnt = count($ups))) return true // Empty string *is* valid UTF-8įor ($i = 1 $i 0 & $i 0x9F) return false This function takes as reference the table 3.6 found at So I have modified the above function and in conjuction with code2utf() function mentioned in some other note here, I have managed to achieve my goal: If you're OK with that, the function can be found here: īut it was not OK with me because I needed a string in my charset to make some comparations and other stuff. I googled the net and found a function which actualy converts these entities into HTML entities (xx ) that your browser can show correctly. They are converted into %uXXXX entities that url_decode() cannot handle. In most cases it is OK to use url_decode() function but not if you've got UTF characters in the strings. I was searching for a function similar to Javascript's unescape(). Return strtr ( utf8_encode ( $str ), $cp1252_map ) "\xc2\x9f" => "\xc5\xb8" /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/ "\xc2\x9e" => "\xc5\xbe", /* LATIN SMALL LETTER Z WITH CARON */ "\xc2\x9b" => "\xe2\x80\xba", /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/ "\xc2\x9a" => "\xc5\xa1", /* LATIN SMALL LETTER S WITH CARON */
"\xc2\x8e" => "\xc5\xbd", /* LATIN CAPITAL LETTER Z WITH CARON */ "\xc2\x8a" => "\xc5\xa0", /* LATIN CAPITAL LETTER S WITH CARON */
"\xc2\x88" => "\xcb\x86", /* MODIFIER LETTER CIRCUMFLEX ACCENT */
SCRIPTCASE ARRAY CODE
Here's some code that addresses the issue that Steven describes in the previous comment
SCRIPTCASE ARRAY ARCHIVE
Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI binary Installed as an Apache module Session Security Filesystem Security Database Security Error Reporting User Submitted Data Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling file uploads Using remote files Connection handling Persistent Database Connections Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation GUI Extensions Keyboard Shortcuts ? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search