|
Posted by Platero on 09/02/06 09:59
Alvaro G. Vicario ha scritto:
>
> What's a 'special character' and what isn't?
hi, a special char can be "à è ì ò ù á ú ó ñ ... " while a non-special
char is a regular "a e i L "...
During the last hours the things are getting more complicated:
I used this function
function char_to_decimal_ent($string){
//
$inner_string = htmlentities($string,ENT_QUOTES);
$entity_array = array(
'¡' => '¡',
'¢' => '¢',
'£' => '£',
'¥' => '¥',
'ª' => 'ª',
'«' => '«',
'°' => '°',
'¸' => '¸',
'»' => '»',
'¿' => '¿',
'À' => 'À',
'Á' => 'Á',
'Â' => 'Â',
'Ã' => 'Ã',
'Ä' => 'Ä',
'Å' => 'Å',
'Æ' => 'Æ',
'Ç' => 'Ç',
'È' => 'È',
'É' => 'É',
'Ê' => 'Ê',
'Ë' => 'Ë',
'Ì' => 'Ì',
'Í' => 'Í',
'Î' => 'Î',
'Ï' => 'Ï',
'Ð' => 'Ð',
'Ñ' => 'Ñ',
'Ò' => 'Ò',
'Ó' => 'Ó',
'Ô' => 'Ô',
'Õ' => 'Õ',
'Ö' => 'Ö',
'×' => '×',
'Ø' => 'Ø',
'Ù' => 'Ù',
'Ú' => 'Ú',
'Û' => 'Û',
'Ü' => 'Ü',
'Ý' => 'Ý',
'Þ' => 'Þ',
'ß' => 'ß',
'à' => 'à',
'á' => 'á',
'â' => 'â',
'ã' => 'ã',
'ä' => 'ä',
'å' => 'å',
'æ' => 'æ',
'ç' => 'ç',
'è' => 'è',
'é' => 'é',
'ê' => 'ê',
'ë' => 'ë',
'ì' => 'ì',
'í' => 'í',
'î' => 'î',
'ï' => 'ï',
'ð' => 'ð',
'ñ' => 'ñ',
'ò' => 'ò',
'ó' => 'ó',
'ô' => 'ô',
'õ' => 'õ',
'ö' => 'ö',
'÷' => '÷',
'ø' => 'ø',
'ù' => 'ù',
'ú' => 'ú',
'û' => 'û',
'ü' => 'ü',
'ý' => 'ý',
'þ' => 'þ',
'ÿ' => 'ÿ',
'ƒ' => 'ƒ',
'⟩' => '〉',
'◊' => '◊',
'"' => '"',
'&' => '&',
'<' => '<',
'>' => '>',
'Œ' => 'Œ',
'œ' => 'œ',
'Š' => 'Š',
'š' => 'š',
'Ÿ' => 'Ÿ',
'ˆ' => 'ˆ',
'˜' => '˜',
'€' => '€');
//
return preg_replace(
"/&[A-Za-z]+;/",
" ",
strtr($inner_string,$entity_array) );
}
but when the data arrives to the db through $_POST, it arrives as
regular LATIN, not encoded :-(((
Navigation:
[Reply to this message]
|