mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Resolve #394
This commit is contained in:
parent
2b22c06b34
commit
894ac99687
1 changed files with 8 additions and 0 deletions
|
|
@ -147,11 +147,19 @@ abstract class Utils
|
|||
return \in_array(\strtoupper($sEncoding), $aSupportedEncodings);
|
||||
}
|
||||
|
||||
private static $RenameEncoding = [
|
||||
'SHIFT_JIS' => 'SJIS'
|
||||
];
|
||||
|
||||
public static function MbConvertEncoding(string $sInputString, ?string $sInputFromEncoding, string $sInputToEncoding) : string
|
||||
{
|
||||
if ($sInputFromEncoding) {
|
||||
$sInputFromEncoding = \strtoupper($sInputFromEncoding);
|
||||
if (isset(static::$RenameEncoding[$sInputFromEncoding])) {
|
||||
$sInputFromEncoding = static::$RenameEncoding[$sInputFromEncoding];
|
||||
}
|
||||
if (!static::MbSupportedEncoding($sInputFromEncoding)) {
|
||||
\error_log("Unsupported encoding {$sInputFromEncoding}");
|
||||
$sInputFromEncoding = null;
|
||||
// return $sInputString;
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue