【原因】
我自己用Sublime Text 2 编Matlab Mfile, 到Matlab Editor中,会出现乱码. 虽然可以通过更改Matlab Font解决问题,但是这样的字体不如原来好看(个人观点).
European languages
ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U, KOI8-RU, CP{1250,1251,1252,1253,1254,1257}, CP{850,866,1131}, Mac{Roman,CentralEurope,Iceland,Croatian,Romania}, Mac{Cyrillic,Ukraine,Greek,Turkish}, Macintosh
Semitic languages
ISO-8859-{6,8}, CP{1255,1256}, CP862, Mac{Hebrew,Arabic}
Japanese
EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2, ISO-2022-JP-1
Chinese
EUC-CN, HZ, GBK, CP936, GB18030, EUC-TW, BIG5, CP950, BIG5-HKSCS, BIG5-HKSCS:2004, BIG5-HKSCS:2001, BIG5-HKSCS:1999, ISO-2022-CN, ISO-2022-CN-EXT
Korean
EUC-KR, CP949, ISO-2022-KR, JOHAB
Armenian
ARMSCII-8
Georgian
Georgian-Academy, Georgian-PS
Tajik
KOI8-T
Kazakh
PT154, RK1048
Thai
ISO-8859-11, TIS-620, CP874, MacThai
Laotian
MuleLao-1, CP1133
Vietnamese
VISCII, TCVN, CP1258
Platform specifics
HP-ROMAN8, NEXTSTEP
Full Unicode
UTF-8
UCS-2, UCS-2BE, UCS-2LE
UCS-4, UCS-4BE, UCS-4LE
UTF-16, UTF-16BE, UTF-16LE
UTF-32, UTF-32BE, UTF-32LE
UTF-7
C99, JAVA
Full Unicode, in terms of uint16_t or uint32_t (with machine dependent endianness and alignment)
UCS-2-INTERNAL, UCS-4-INTERNAL
1. UTF-8 to GBK
2. GBK to UTF-8
对应界面如下(修改prompt.txt内容后会相应改变:
; ini file to txt file for GUI prompt
FileRead, txtContent, %A_ScriptDir%\argument\prompt.txt
Gui, Font, s18 c0000FF, Ariel
Gui, Add, Text,section, Converting List:
Gui, Font, s14 c000000, Ariel
Gui, Add, Text,section, %txtContent%
Gui, Font, s18 c0000FF, Ariel
Gui, Add, Text,section, Choose No:
Gui, Add, Edit, vModel ys w30
Gui, Add, Button,section xs h50 w100 default, &OK
Gui, Add, Button,xs+200 ys h50 w100 , &Cancel
Gui, Show, xcenter ycenter, Choose convertting encodings
return
ButtonOK:
Gui, Submit
;Msgbox,OK No.%Model%
c_left = %Model%Left
c_right = %Model%Right
;Msgbox,%c_left% to %c_right%
IniRead, c_left, %A_ScriptDir%\argument\ConvertList.ini, ConvertList, %c_left%
IniRead, c_right, %A_ScriptDir%\argument\ConvertList.ini, ConvertList, %c_right%
;Msgbox,%c_left% to %c_right%
If 0 =0
{
;Convert
FileSelectFile, files, M3, , Open an Text file or files needed to convert endoing.
Loop, parse, files, `n
{
if a_index = 1
;MsgBox, The selected files are all contained in %A_LoopField%. ;Dir
dirInput=%A_LoopField%
else
{
filename=%A_LoopField%
pathInput=%dirInput%\%filename%
SplitPath,pathInput,,,extInput,nameInputNoExt
SetWorkingDir %dirInput%
pathOutput=%nameInputNoExt%_ori.%extInput%
Filecopy,%pathInput%,%pathOutput%
pathTemp =%nameInputNoExt%_temp.%extInput%
;Convert encoding ->****.***
App_iconv = %A_ScriptDir%\argument\iconv.exe -f %c_left% -t %c_right%
command =%App_iconv% %nameInputNoExt%_ori.%extInput% > %pathTemp%
SetWorkingDir %dirInput%
; Here this batch script is used to run command because that it doesn't work directly with "run, %command%"(Strange!)
FileDelete, %nameInputNoExt%_command.bat
If ErrorLevel
{
FileAppend, %command%,%nameInputNoExt%_command.bat
runwait, %nameInputNoExt%_command.bat
FileDelete, %nameInputNoExt%_command.bat
FileDelete, %pathInput%
Filecopy, %pathTemp%, %pathInput%
FileDelete,%pathTemp%
}
else
{
Msgbox, Already converted
}
}
}
}
else
{
;Convert
Loop, %0% ; For each parameter: %P%S in TC start menu
{
pathInput := %A_Index% ; Fetch the contents of the variable whose path is contained in A_Index.
;original file -> ****_ori.***
SplitPath,pathInput,,dirInput,extInput,nameInputNoExt
SetWorkingDir, %dirInput%
pathOutput=%nameInputNoExt%_ori.%extInput%
Filecopy,%pathInput%,%pathOutput%
pathTemp =%nameInputNoExt%_temp.%extInput%
;Convert encoding ->****.***
App_iconv = %A_ScriptDir%\argument\iconv.exe -f %c_left% -t %c_right%
command =%App_iconv% %nameInputNoExt%_ori.%extInput% > %pathTemp%
; Here this batch script is used to run command because that it doesn't work directly with "run, %command%"(Strange!)
FileDelete, %nameInputNoExt%_command.bat
If ErrorLevel
{
FileAppend, %command%,%nameInputNoExt%_command.bat
runwait, %nameInputNoExt%_command.bat
FileDelete, %nameInputNoExt%_command.bat
FileDelete, %pathInput%
Filecopy, %pathTemp%, %pathInput%
FileDelete, %pathTemp%
}
else
{
Msgbox, Already converted
}
}
}
ExitApp
GuiClose:
ExitApp
ButtonCancel:
;Msgbox, Cancel
ExitApp