Subversion Repositories Applications.bazar

Rev

Rev 479 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 479 Rev 483
Line 1388... Line 1388...
1388
	return $res ;
1388
	return $res ;
1389
}
1389
}
Line 1390... Line 1390...
1390
 
1390
 
1391
function transformerTxtPourRss($txt) {
1391
function transformerTxtPourRss($txt) {
1392
	$txt_utf8 = encoderEnUtf8($txt);
1392
	$txt_utf8 = encoderEnUtf8($txt);
1393
	$txt_utf8 = remplacerEsperluettesIsoleesParEntiteHtml($txt_utf8);
1393
	$txt_utf8 = htmlspecialchars($txt_utf8, ENT_NOQUOTES, "UTF-8", false);
1394
	$txt_utf8 = remplacerCaracteresAsciiInvisibles($txt_utf8);
1394
	$txt_utf8 = remplacerCaracteresAsciiInvisibles($txt_utf8);
1395
	$txt_utf8 = remplacerCaracteresCp1252Problematiques($txt_utf8);
1395
	$txt_utf8 = remplacerCaracteresCp1252Problematiques($txt_utf8);
Line 1396... Line 1396...
1396
	return $txt_utf8;
1396
	return $txt_utf8;
Line 1400... Line 1400...
1400
function encoderEnUtf8($txtEnIso88591) {
1400
function encoderEnUtf8($txtEnIso88591) {
1401
	$txtEnUtf8 = utf8_encode($txtEnIso88591);
1401
	$txtEnUtf8 = utf8_encode($txtEnIso88591);
1402
	return $txtEnUtf8;
1402
	return $txtEnUtf8;
1403
}
1403
}
Line 1404... Line -...
1404
 
-
 
1405
function remplacerEsperluettesIsoleesParEntiteHtml($txtEnUtf8) {
-
 
1406
	$txtEnUtf8 = preg_replace('/ \x{0026} /u', ' & ', $txtEnUtf8);// Remplacement des & isol�s
-
 
1407
	return $txtEnUtf8;
-
 
1408
}
-
 
1409
 
1404
 
1410
function remplacerCaracteresAsciiInvisibles($txtEnUtf8) {
1405
function remplacerCaracteresAsciiInvisibles($txtEnUtf8) {
1411
	$ascii_remplacements = array (
1406
	$ascii_remplacements = array (
1412
		'\x00' => '', // NUL : Null (nul)
1407
		'\x00' => '', // NUL : Null (nul)
1413
		'\x01' => '', // SOH : Start of Header (d�but d'en-t�te)
1408
		'\x01' => '', // SOH : Start of Header (d�but d'en-t�te)