Subversion Repositories Sites.gentiana.org

Rev

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

Rev 87 Rev 88
Line 239... Line 239...
239
 */
239
 */
240
function translittererCp1252VersIso88591($str, $translit = true) {
240
function translittererCp1252VersIso88591($str, $translit = true) {
241
	$cp1252_entite_map = array(
241
	$cp1252_entite_map = array(
242
	   '\x80' => '€', /* EURO SIGN */
242
	   '\x80' => '€', /* EURO SIGN */
243
	   '\x82' => '‚', /* SINGLE LOW-9 QUOTATION MARK */
243
	   '\x82' => '‚', /* SINGLE LOW-9 QUOTATION MARK */
244
	   '\x83' => 'ƒ',     /* LATIN SMALL LETTER F WITH HOOK */
244
	   '\x83' => 'ƒ',  /* LATIN SMALL LETTER F WITH HOOK */
245
	   '\x84' => '„', /* DOUBLE LOW-9 QUOTATION MARK */
245
	   '\x84' => '„', /* DOUBLE LOW-9 QUOTATION MARK */
246
	   '\x85' => '…', /* HORIZONTAL ELLIPSIS */
246
	   '\x85' => '…', /* HORIZONTAL ELLIPSIS */
247
	   '\x86' => '†', /* DAGGER */
247
	   '\x86' => '†', /* DAGGER */
248
	   '\x87' => '‡', /* DOUBLE DAGGER */
248
	   '\x87' => '‡', /* DOUBLE DAGGER */
249
	   '\x88' => 'ˆ',     /* MODIFIER LETTER CIRCUMFLEX ACCENT */
249
	   '\x88' => 'ˆ',  /* MODIFIER LETTER CIRCUMFLEX ACCENT */
250
	   '\x89' => '‰', /* PER MILLE SIGN */
250
	   '\x89' => '‰', /* PER MILLE SIGN */
251
	   '\x8a' => 'Š',     /* LATIN CAPITAL LETTER S WITH CARON */
251
	   '\x8a' => 'Š',  /* LATIN CAPITAL LETTER S WITH CARON */
252
	   '\x8b' => '‹', /* SINGLE LEFT-POINTING ANGLE QUOTATION */
252
	   '\x8b' => '‹', /* SINGLE LEFT-POINTING ANGLE QUOTATION */
253
	   '\x8c' => 'Œ',     /* LATIN CAPITAL LIGATURE OE */
253
	   '\x8c' => 'Œ',  /* LATIN CAPITAL LIGATURE OE */
254
	   '\x8e' => 'Ž',     /* LATIN CAPITAL LETTER Z WITH CARON */
254
	   '\x8e' => 'Ž',  /* LATIN CAPITAL LETTER Z WITH CARON */
255
	   '\x91' => '‘', /* LEFT SINGLE QUOTATION MARK */
255
	   '\x91' => '‘', /* LEFT SINGLE QUOTATION MARK */
256
	   '\x92' => '’', /* RIGHT SINGLE QUOTATION MARK */
256
	   '\x92' => '’', /* RIGHT SINGLE QUOTATION MARK */
257
	   '\x93' => '“', /* LEFT DOUBLE QUOTATION MARK */
257
	   '\x93' => '“', /* LEFT DOUBLE QUOTATION MARK */
258
	   '\x94' => '”', /* RIGHT DOUBLE QUOTATION MARK */
258
	   '\x94' => '”', /* RIGHT DOUBLE QUOTATION MARK */
259
	   '\x95' => '•', /* BULLET */
259
	   '\x95' => '•', /* BULLET */
260
	   '\x96' => '–', /* EN DASH */
260
	   '\x96' => '–', /* EN DASH */
261
	   '\x97' => '—', /* EM DASH */
261
	   '\x97' => '—', /* EM DASH */
262
	   '\x98' => '˜',     /* SMALL TILDE */
262
	   '\x98' => '˜',  /* SMALL TILDE */
263
	   '\x99' => '™', /* TRADE MARK SIGN */
263
	   '\x99' => '™', /* TRADE MARK SIGN */
264
	   '\x9a' => 'š',     /* LATIN SMALL LETTER S WITH CARON */
264
	   '\x9a' => 'š',  /* LATIN SMALL LETTER S WITH CARON */
265
	   '\x9b' => '›', /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
265
	   '\x9b' => '›', /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
266
	   '\x9c' => 'œ',     /* LATIN SMALL LIGATURE OE */
266
	   '\x9c' => 'œ',  /* LATIN SMALL LIGATURE OE */
267
	   '\x9e' => 'ž',     /* LATIN SMALL LETTER Z WITH CARON */
267
	   '\x9e' => 'ž',  /* LATIN SMALL LETTER Z WITH CARON */
268
	   '\x9f' => 'Ÿ'      /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
268
	   '\x9f' => 'Ÿ'   /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
269
	);
269
	);
270
	$translit_map = array(
270
	$translit_map = array(
271
	   '€' => 	'Euro', /* EURO SIGN */
271
	   '€' => 'Euro', /* EURO SIGN */
272
	   '‚' => ',', /* SINGLE LOW-9 QUOTATION MARK */
272
	   '‚' => ',',    /* SINGLE LOW-9 QUOTATION MARK */
273
	   'ƒ' => 'f',  /* LATIN SMALL LETTER F WITH HOOK */
273
	   'ƒ' => 'f',     /* LATIN SMALL LETTER F WITH HOOK */
274
	   '„' => ',,', /* DOUBLE LOW-9 QUOTATION MARK */
274
	   '„' => ',,',   /* DOUBLE LOW-9 QUOTATION MARK */
275
	   '…' => '...', /* HORIZONTAL ELLIPSIS */
275
	   '…' => '...',  /* HORIZONTAL ELLIPSIS */
276
	   '†' => '+', /* DAGGER */
276
	   '†' => '+',    /* DAGGER */
277
	   '‡' => '++', /* DOUBLE DAGGER */
277
	   '‡' => '++',   /* DOUBLE DAGGER */
278
	   'ˆ' => '^',  /* MODIFIER LETTER CIRCUMFLEX ACCENT */
278
	   'ˆ' => '^',     /* MODIFIER LETTER CIRCUMFLEX ACCENT */
279
	   '‰' => '0/00', /* PER MILLE SIGN */
279
	   '‰' => '0/00', /* PER MILLE SIGN */
280
	   'Š' => 'S',  /* LATIN CAPITAL LETTER S WITH CARON */
280
	   'Š' => 'S',     /* LATIN CAPITAL LETTER S WITH CARON */
281
	   '&#8249;' => '<', /* SINGLE LEFT-POINTING ANGLE QUOTATION */
281
	   '&#8249;' => '<',    /* SINGLE LEFT-POINTING ANGLE QUOTATION */
282
	   '&#338;' => 'OE',  /* LATIN CAPITAL LIGATURE OE */
282
	   '&#338;' => 'OE',    /* LATIN CAPITAL LIGATURE OE */
283
	   '&#381;' => 'Z',  /* LATIN CAPITAL LETTER Z WITH CARON */
283
	   '&#381;' => 'Z',     /* LATIN CAPITAL LETTER Z WITH CARON */
284
	   '&#8216;' => "'", /* LEFT SINGLE QUOTATION MARK */
284
	   '&#8216;' => "'",    /* LEFT SINGLE QUOTATION MARK */
285
	   '&#8217;' => "'", /* RIGHT SINGLE QUOTATION MARK */
285
	   '&#8217;' => "'",    /* RIGHT SINGLE QUOTATION MARK */
286
	   '&#8220;' => '"', /* LEFT DOUBLE QUOTATION MARK */
286
	   '&#8220;' => '"',    /* LEFT DOUBLE QUOTATION MARK */
287
	   '&#8221;' => '"', /* RIGHT DOUBLE QUOTATION MARK */
287
	   '&#8221;' => '"',    /* RIGHT DOUBLE QUOTATION MARK */
288
	   '&#8226;' => '*', /* BULLET */
288
	   '&#8226;' => '*',    /* BULLET */
289
	   '&#8211;' => '-', /* EN DASH */
289
	   '&#8211;' => '-',    /* EN DASH */
290
	   '&#8212;' => '--', /* EM DASH */
290
	   '&#8212;' => '--',   /* EM DASH */
291
	   '&#732;' => '~',  /* SMALL TILDE */
291
	   '&#732;' => '~',     /* SMALL TILDE */
292
	   '&#8482;' => '(TM)', /* TRADE MARK SIGN */
292
	   '&#8482;' => '(TM)', /* TRADE MARK SIGN */
293
	   '&#353;' => 's',  /* LATIN SMALL LETTER S WITH CARON */
293
	   '&#353;' => 's',     /* LATIN SMALL LETTER S WITH CARON */
294
	   '&#8250;' => '>', /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
294
	   '&#8250;' => '>',    /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
295
	   '&#339;' => 'oe',  /* LATIN SMALL LIGATURE OE */
295
	   '&#339;' => 'oe',    /* LATIN SMALL LIGATURE OE */
296
	   '&#382;' => 'z',  /* LATIN SMALL LETTER Z WITH CARON */
296
	   '&#382;' => 'z',     /* LATIN SMALL LETTER Z WITH CARON */
297
	   '&#376;' => 'Y'   /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
297
	   '&#376;' => 'Y'      /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
298
	);
298
	);
299
	$str = strtr($str, $cp1252_entite_map);
299
	$str = strtr($str, $cp1252_entite_map);
300
	if ($translit) {
300
	if ($translit) {
301
		$str = strtr($str, $translit_map);
301
		$str = strtr($str, $translit_map);
302
	}
302
	}