Mercurial > hg > rc2
comparison program/lib/Roundcube/rcube_charset.php @ 12:5039cc34571f
some old, mostly new 7.3->8.4 changes needed
| author | Charlie Root |
|---|---|
| date | Thu, 28 Aug 2025 10:37:42 -0400 |
| parents | 4681f974d28b |
| children |
comparison
equal
deleted
inserted
replaced
| 11:aff04b06b685 | 12:5039cc34571f |
|---|---|
| 218 if (isset(self::$aliases[$str])) { | 218 if (isset(self::$aliases[$str])) { |
| 219 $result = self::$aliases[$str]; | 219 $result = self::$aliases[$str]; |
| 220 } | 220 } |
| 221 // UTF | 221 // UTF |
| 222 else if (preg_match('/U[A-Z][A-Z](7|8|16|32)(BE|LE)*/', $str, $m)) { | 222 else if (preg_match('/U[A-Z][A-Z](7|8|16|32)(BE|LE)*/', $str, $m)) { |
| 223 $result = 'UTF-' . $m[1] . $m[2]; | 223 $result = 'UTF-' . $m[1] . (isset($m[2]) ? $m2 : '') ; |
| 224 } | 224 } |
| 225 // ISO-8859 | 225 // ISO-8859 |
| 226 else if (preg_match('/ISO8859([0-9]{0,2})/', $str, $m)) { | 226 else if (preg_match('/ISO8859([0-9]{0,2})/', $str, $m)) { |
| 227 $iso = 'ISO-8859-' . ($m[1] ?: 1); | 227 $iso = 'ISO-8859-' . ($m[1] ?: 1); |
| 228 // some clients sends windows-1252 text as latin1, | 228 // some clients sends windows-1252 text as latin1, |
| 335 'WINDOWS-1257' => 'ISO-8859-13', | 335 'WINDOWS-1257' => 'ISO-8859-13', |
| 336 'US-ASCII' => 'ASCII', | 336 'US-ASCII' => 'ASCII', |
| 337 'ISO-2022-JP' => 'ISO-2022-JP-MS', | 337 'ISO-2022-JP' => 'ISO-2022-JP-MS', |
| 338 ); | 338 ); |
| 339 | 339 |
| 340 $mb_from = $aliases[$from] ?: $from; | 340 $mb_from = $aliases[$from] ?? $from; |
| 341 $mb_to = $aliases[$to] ?: $to; | 341 $mb_to = $aliases[$to] ?? $to; |
| 342 | 342 |
| 343 // Do the same as //IGNORE with iconv | 343 // Do the same as //IGNORE with iconv |
| 344 mb_substitute_character('none'); | 344 mb_substitute_character('none'); |
| 345 | 345 |
| 346 // throw an exception if mbstring reports an illegal character in input | 346 // throw an exception if mbstring reports an illegal character in input |
