Line 1308... |
Line 1308... |
1308 |
|
1308 |
|
1309 |
return $res ;
|
1309 |
return $res ;
|
Line 1310... |
Line 1310... |
1310 |
}
|
1310 |
}
|
1311 |
|
1311 |
|
- |
|
1312 |
function encoder_en_utf8($txt) {
|
1312 |
function encoder_en_utf8($txt) {
|
1313 |
// Nous remplaçons l'apostrophe de type RIGHT SINGLE QUOTATION MARK et les & isolées qui n'auraient pas été
|
- |
|
1314 |
// remplacées par une entitée HTML et les autres caractères incompatibles provenant de cp1252 sous Windows
|
- |
|
1315 |
$cp1252_map = array (
|
- |
|
1316 |
"\xc2\x80" => "\xe2\x82\xac", /* EURO SIGN */
|
- |
|
1317 |
"\xc2\x82" => "\xe2\x80\x9a", /* SINGLE LOW-9 QUOTATION MARK */
|
- |
|
1318 |
"\xc2\x83" => "\xc6\x92", /* LATIN SMALL LETTER F WITH HOOK */
|
- |
|
1319 |
"\xc2\x84" => "\xe2\x80\x9e", /* DOUBLE LOW-9 QUOTATION MARK */
|
- |
|
1320 |
"\xc2\x85" => "\xe2\x80\xa6", /* HORIZONTAL ELLIPSIS */
|
- |
|
1321 |
"\xc2\x86" => "\xe2\x80\xa0", /* DAGGER */
|
- |
|
1322 |
"\xc2\x87" => "\xe2\x80\xa1", /* DOUBLE DAGGER */
|
- |
|
1323 |
"\xc2\x88" => "\xcb\x86", /* MODIFIER LETTER CIRCUMFLEX ACCENT */
|
- |
|
1324 |
"\xc2\x89" => "\xe2\x80\xb0", /* PER MILLE SIGN */
|
- |
|
1325 |
"\xc2\x8a" => "\xc5\xa0", /* LATIN CAPITAL LETTER S WITH CARON */
|
- |
|
1326 |
"\xc2\x8b" => "\xe2\x80\xb9", /* SINGLE LEFT-POINTING ANGLE QUOTATION */
|
- |
|
1327 |
"\xc2\x8c" => "\xc5\x92", /* LATIN CAPITAL LIGATURE OE */
|
1313 |
// Nous remplaçons l'apostrophe de type RIGHT SINGLE QUOTATION MARK et les & isolées qui n'auraient pas été
|
1328 |
"\xc2\x8e" => "\xc5\xbd", /* LATIN CAPITAL LETTER Z WITH CARON */
|
- |
|
1329 |
"\xc2\x91" => "\xe2\x80\x98", /* LEFT SINGLE QUOTATION MARK */
|
- |
|
1330 |
"\xc2\x92" => "\xe2\x80\x99", /* RIGHT SINGLE QUOTATION MARK */
|
- |
|
1331 |
"\xc2\x93" => "\xe2\x80\x9c", /* LEFT DOUBLE QUOTATION MARK */
|
- |
|
1332 |
"\xc2\x94" => "\xe2\x80\x9d", /* RIGHT DOUBLE QUOTATION MARK */
|
- |
|
1333 |
"\xc2\x95" => "\xe2\x80\xa2", /* BULLET */
|
- |
|
1334 |
"\xc2\x96" => "\xe2\x80\x93", /* EN DASH */
|
- |
|
1335 |
"\xc2\x97" => "\xe2\x80\x94", /* EM DASH */
|
- |
|
1336 |
"\xc2\x98" => "\xcb\x9c", /* SMALL TILDE */
|
- |
|
1337 |
"\xc2\x99" => "\xe2\x84\xa2", /* TRADE MARK SIGN */
|
- |
|
1338 |
"\xc2\x9a" => "\xc5\xa1", /* LATIN SMALL LETTER S WITH CARON */
|
- |
|
1339 |
"\xc2\x9b" => "\xe2\x80\xba", /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
|
- |
|
1340 |
"\xc2\x9c" => "\xc5\x93", /* LATIN SMALL LIGATURE OE */
|
- |
|
1341 |
"\xc2\x9e" => "\xc5\xbe", /* LATIN SMALL LETTER Z WITH CARON */
|
- |
|
1342 |
"\xc2\x9f" => "\xc5\xb8" /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
|
1314 |
// remplacées par une entitée HTML.
|
1343 |
);
|
- |
|
1344 |
|
- |
|
1345 |
//return strtr(preg_replace('/ \x{0026} /u', ' & ', mb_convert_encoding($txt, 'UTF-8','HTML-ENTITIES')), $cp1252_map);
|
1315 |
$cp1252_map = array("\xc2\x92" => "\xe2\x80\x99" /* RIGHT SINGLE QUOTATION MARK */);
|
1346 |
return strtr(preg_replace('/ \x{0026} /u', ' & ', utf8_encode($txt)), $cp1252_map);
|
Line 1316... |
Line 1347... |
1316 |
return strtr(preg_replace('/ \x{0026} /u', ' & ', mb_convert_encoding($txt, 'UTF-8','HTML-ENTITIES')), $cp1252_map);
|
1347 |
|
1317 |
}
|
1348 |
}
|
1318 |
|
1349 |
|