The text file format conversion tool that comes with the Mac OS X system Iconv

Source: Internet
Author: User

1. Utf-8 Transfer to GBK method

Run Iconv-f UTF-8-T GBK test_utf8.txt > Test_gbk.txt directly in Mac Bash


  Example: Creating a test file

echo "Bonnie Big Data | Learn elder sister notes Fruit and fruit learning elder sister" > Test_utf8.txt

Convert command

Iconv-f UTF-8-T GBK test_utf8.txt > Test_gbk.txt

Other formats similarly

2. Use Iconv-l to view the encoding formats supported by this method

iconv-l
ansi_x3.4-1968 ansi_x3.4-1986 ASCII CP367 IBM367 iso-ir-6 iso646-us iso_646.irv:1991 US us-ascii csascii
UTF-8 UTF8
Utf-8-mac Utf8-mac
iso-10646-ucs-2 UCS-2 Csunicode
ucs-2be unicode-1-1 unicodebig CSUNICODE11
Ucs-2le Unicodelittle
iso-10646-ucs-4 UCS-4 CSUCS4
Ucs-4be
Ucs-4le
UTF-16
Utf-16be
Utf-16le
UTF-32
Utf-32be
Utf-32le
unicode-1-1-utf-7 UTF-7 Csunicode11utf7
ucs-2-internal
ucs-2-swapped
ucs-4-internal
ucs-4-swapped
C99
JAVA
CP819 IBM819 iso-8859-1 iso-ir-100 iso8859-1 iso_8859-1 iso_8859-1:1987 L1 LATIN1 CSISOLATIN1
iso-8859-2 iso-ir-101 iso8859-2 iso_8859-2 iso_8859-2:1987 L2 LATIN2 CSISOLATIN2
iso-8859-3 iso-ir-109 iso8859-3 iso_8859-3 iso_8859-3:1988 L3 LATIN3 CSISOLATIN3
iso-8859-4 iso-ir-110 iso8859-4 iso_8859-4 iso_8859-4:1988 L4 LATIN4 CSISOLATIN4
Cyrillic iso-8859-5 iso-ir-144 iso8859-5 iso_8859-5 iso_8859-5:1988 csisolatincyrillic
ARABIC ASMO-708 ECMA-114 iso-8859-6 iso-ir-127 iso8859-6 iso_8859-6 iso_8859-6:1987 csisolatinarabic
ECMA-118 elot_928 GREEK GREEK8 iso-8859-7 iso-ir-126 iso8859-7 iso_8859-7 iso_8859-7:1987 iso_8859-7:2003 Csisolatingreek
HEBREW iso-8859-8 iso-ir-138 iso8859-8 iso_8859-8 iso_8859-8:1988 csisolatinhebrew
iso-8859-9 iso-ir-148 iso8859-9 iso_8859-9 iso_8859-9:1989 L5 LATIN5 CSISOLATIN5
iso-8859-10 iso-ir-157 iso8859-10 iso_8859-10 iso_8859-10:1992 L6 LATIN6 CSISOLATIN6
iso-8859-11 iso8859-11 iso_8859-11
iso-8859-13 iso-ir-179 iso8859-13 iso_8859-13 L7 LATIN7
iso-8859-14 iso-celtic iso-ir-199 iso8859-14 iso_8859-14 iso_8859-14:1998 L8 LATIN8
iso-8859-15 iso-ir-203 iso8859-15 iso_8859-15 iso_8859-15:1998 LATIN-9
iso-8859-16 iso-ir-226 iso8859-16 iso_8859-16 iso_8859-16:2001 L10 LATIN10
koi8-r cskoi8r
Koi8-u
Koi8-ru
CP1250 Ms-ee WINDOWS-1250
CP1251 Ms-cyrl WINDOWS-1251
CP1252 Ms-ansi WINDOWS-1252
CP1253 Ms-greek WINDOWS-1253
CP1254 Ms-turk WINDOWS-1254
CP1255 Ms-hebr WINDOWS-1255
CP1256 ms-arab WINDOWS-1256
CP1257 Winbaltrim WINDOWS-1257
CP1258 WINDOWS-1258
850 CP850 IBM850 cspc850multilingual
862 CP862 IBM862 cspc862latinhebrew
866 CP866 IBM866 CSIBM866
MAC MACINTOSH Macroman csmacintosh
Maccentraleurope
Maciceland
Maccroatian
Macromania
Maccyrillic
Macukraine
Macgreek
Macturkish
Machebrew
Macarabic
Macthai
hp-roman8 R8 ROMAN8 CSHPROMAN8
NEXTSTEP
ARMSCII-8
Georgian-academy
Georgian-ps
koi8-t
CP154 Cyrillic-asian PT154 PTCP154 CSPTCP154
MULELAO-1
CP1133 ibm-cp1133
iso-ir-166 TIS-620 TIS620 tis620-0 tis620.2529-1 tis620.2533-0 tis620.2533-1
CP874 WINDOWS-874
viscii viscii1.1-1 csviscii
tcvn TCVN-5712 tcvn5712-1 tcvn5712-1:1993
iso-ir-14 iso646-jp jis_c6220-1969-ro JP csiso14jisc6220ro
jisx0201-1976 jis_x0201 X0201 Cshalfwidthkatakana
iso-ir-87 JIS0208 jis_c6226-1983 jis_x0208 jis_x0208-1983 jis_x0208-1990 X0208 csiso87jisx0208
iso-ir-159 jis_x0212 jis_x0212-1990 jis_x0212.1990-0 X0212 csiso159jisx02121990
CN gb_1988-80 iso-ir-57 iso646-cn csiso57gb1988
Chinese gb_2312-80 iso-ir-58 csiso58gb231280
cn-gb-isoir165 iso-ir-165
iso-ir-149 KOREAN ksc_5601 ks_c_5601-1987 ks_c_5601-1989 CSKSC56011987
euc-jp eucjp Extended_unix_code_packed_format_for_japanese Cseucpkdfmtjapanese
Ms_kanji shift-jis shift_jis SJIS csshiftjis
CP932
ISO-2022-JP CSISO2022JP
iso-2022-jp-1
iso-2022-jp-2 CSISO2022JP2
CN-GB euc-cn EUCCN GB2312 CSGB2312
GBK
CP936 MS936 WINDOWS-936
GB18030
ISO-2022-CN CSISO2022CN
Iso-2022-cn-ext
HZ hz-gb-2312
euc-tw euctw cseuctw
BIG-5 big-five BIG5 bigfive cn-big5 CSBIG5
CP950
big5-hkscs:1999
big5-hkscs:2001
Big5-hkscs big5-hkscs:2004 Big5hkscs
euc-kr Euckr Cseuckr
CP949 UHC
CP1361 Johab
Iso-2022-kr Csiso2022kr
CP856
CP922
CP943
CP1046
CP1124
CP1129
CP1161 IBM-1161 IBM1161 CSIBM1161
CP1162 IBM-1162 IBM1162 CSIBM1162
CP1163 IBM-1163 IBM1163 CSIBM1163
Dec-kanji
Dec-hanyu
437 CP437 IBM437 cspc8codepage437
CP737
CP775 IBM775 cspc775baltic
852 CP852 IBM852 CSPCP852
CP853
855 CP855 IBM855 CSIBM855
857 CP857 IBM857 CSIBM857
CP858
860 CP860 IBM860 CSIBM860
861 cp-is CP861 IBM861 CSIBM861
863 CP863 IBM863 CSIBM863
CP864 IBM864 CSIBM864
865 CP865 IBM865 CSIBM865
869 cp-gr CP869 IBM869 CSIBM869
CP1125
euc-jisx0213
shift_jisx0213
iso-2022-jp-3
big5-2003
iso-ir-230 TDS565
ATARI atarist
riscos-latin1

  

The text file format conversion tool that comes with the Mac OS X system Iconv

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.