Heim  >  Artikel  >  Backend-Entwicklung  >  【通译】PHP中 文字编码变换时 使用SJIS-win而非SJIS,使用eucJP-win而非EUC-JP

【通译】PHP中 文字编码变换时 使用SJIS-win而非SJIS,使用eucJP-win而非EUC-JP

WBOY
WBOYOriginal
2016-06-13 13:04:101327Durchsuche

【翻译】PHP中 文字编码变换时 使用SJIS-win而非SJIS,使用eucJP-win而非EUC-JP
使用SJIS-win而非SJIS,使用eucJP-win而非EUC-JP
From: http://pentan.info/php/sjiswin_eucjpwin.html

在文字编码变换的指定中,如果想使用Shift_JIS,就请使用SJIS-win而不是SJIS。
如果想使用EUC-JP,就请使用eucJP-win而不是EUC-JP。

带上win,则连Windows扩展的文字,也能够顺利地变换。

除此以外,其他用途的文字编码,指定为SJIS、EUC-JP也没有关系。
PHP中可以使用的文字编码,用mb_list_encodings()可以取得编码列表。

顺便提一下,HTML中,可以指定Shift_JIS、EUC-JP(Extended Unix Code Packed Format for Japanese的别名)、
UTF-9等。

举例:PHP中可以使用的文字编码

pass
auto
wchar
byte2be
byte2le
byte4be
byte4le
BASE64
UUENCODE
HTML-ENTITIES
Quoted-Printable
7bit
8bit
UCS-4
UCS-4BE
UCS-4LE
UCS-2
UCS-2BE
UCS-2LE
UTF-32
UTF-32BE
UTF-32LE
UTF-16
UTF-16BE
UTF-16LE
UTF-8
UTF-7
UTF7-IMAP
ASCII
EUC-JP
SJIS
eucJP-win
SJIS-win
CP51932
JIS
ISO-2022-JP
ISO-2022-JP-MS
Windows-1252
ISO-8859-1
ISO-8859-2
ISO-8859-3
ISO-8859-4
ISO-8859-5
ISO-8859-6
ISO-8859-7
ISO-8859-8
ISO-8859-9
ISO-8859-10
ISO-8859-13
ISO-8859-14
ISO-8859-15
ISO-8859-16
EUC-CN
CP936
HZ
EUC-TW
BIG-5
EUC-KR
UHC
ISO-2022-KR
Windows-1251
CP866
KOI8-R
ArmSCII-8
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn