如何将一个繁体字的txt文件转换为简体字的txt文件?
如何将一个繁体字的txt文件转换为简体字的txt文件?
[解决办法]
可以利用VBA的word来处理
也可以利用数据库来转换
如果VBA处理不好,数据库你又没有文件,我觉得可以去利用google翻译去转。
[解决办法]
补充一个我未验证的 API
Private Declare Function LCMapString Lib "kernel32 " Alias "LCMapStringA " (ByVal Locale As Long, ByVal dwMapFlags As Long, ByVal lpSrcStr As String, ByVal cchSrc As Long, ByVal lpDestStr As String, ByVal cchDest As Long) As Long
Private Declare Function lstrlen Lib "kernel32 " Alias "lstrlenA " (ByVal lpString As String) As Long
'简转繁
Public Function JToF(ByVal Str As String) As String
Dim STlen As Long
Dim STf As String
STlen = lstrlen(Str)
STf = Space(STlen)
LCMapString &H804, &H4000000, Str, STlen, STf, STlen
JToF = STf
End Function
'繁转简
Public Function FToJ(ByVal Str As String) As String
Dim STlen As Long
Dim STj As String
STlen = lstrlen(Str)
STj = Space(STlen)
LCMapString &H804, &H2000000, Str, STlen, STj, STlen
FToJ = STj
End Function