macOS Mojave下解决wine中文乱码问题
macOS Mojave下解決wine中文亂碼問題
起因是需要用epidata錄入數(shù)據(jù),但是epidata3.1只有windows版,所以想到用wine來解決這個問題。翻閱了網(wǎng)上的各種資料,但資料主要是Ubuntu系統(tǒng)下的解決方案,并未有專門針對Mac下的解決方案,故寫此篇文章。
具體步驟如下:
1. 初始設(shè)置
運行 winecfg,把模擬的 Windows 系統(tǒng)設(shè)置為 Windows XP 或者 Windows 2000。
2. 準(zhǔn)備字體
為了讓 Windows 應(yīng)用程序看上去更美觀,所以需要 Windows 下面的字體。
經(jīng)將 simsun.ttc 復(fù)制到 下面第一行代碼表示的目錄中,并且在wine的字體目錄中創(chuàng)建然鏈接。創(chuàng)建一個 simfang.ttc 是許多 Windows 應(yīng)用默認(rèn)使用 simfang.ttc 字體。
3. 修改注冊表設(shè)置
裝好字體后,還要修改一下 Wine 的注冊表設(shè)置,指定與字體相關(guān)的設(shè)置:
vim ~/.wine/system.reg 搜索: LogPixels 找到的行應(yīng)該是:[System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts] 將其中的: "LogPixels"=dword:00000060 改為: "LogPixels"=dword:00000070 搜索: FontSubstitutes 找到的行應(yīng)該是:[Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes] 將其中的: "MS Shell Dlg"="Tahoma" "MS Shell Dlg 2″="Tahoma" 改為: "MS Shell Dlg"="SimSun" "MS Shell Dlg 2″="SimSun"4. 修改 win.ini
vim ~/.wine/drive_c/windows/win.ini 在文件末尾加入: [Desktop] menufontsize=13 messagefontsize=13 statusfontsize=13 IconTitleSize=135. 更改注冊表
將下面的代碼寫成zh.reg放到桌面,然后修改注冊表鍵值。
REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes] "Arial"="simsun" "Arial CE,238"="simsun" "Arial CYR,204"="simsun" "Arial Greek,161"="simsun" "Arial TUR,162"="simsun" "Courier New"="simsun" "Courier New CE,238"="simsun" "Courier New CYR,204"="simsun" "Courier New Greek,161"="simsun" "Courier New TUR,162"="simsun" "FixedSys"="simsun" "Helv"="simsun" "Helvetica"="simsun" "MS Sans Serif"="simsun" "MS Shell Dlg"="simsun" "MS Shell Dlg 2"="simsun" "System"="simsun" "Tahoma"="simsun" "Times"="simsun" "Times New Roman CE,238"="simsun" "Times New Roman CYR,204"="simsun" "Times New Roman Greek,161"="simsun" "Times New Roman TUR,162"="simsun" "Tms Rmn"="simsun"修改注冊表鍵值,在終端輸入如下命令。
regedit /Users/你的用戶名/Desktop/zh.reg6. 設(shè)定wine命令執(zhí)行時的語言環(huán)境
alias wine="env LC_ALL=zh_CN.UTF-8 wine"這樣就能解決Mac下wine99%的亂碼問題。
第1-5步最主要的是解決了wine下的顯示問題,可以讓顯示變的更加舒服,第6步保證在打漢語程序時不會亂碼。如果不在乎顯示效果,可以直接執(zhí)行第7步。
下面是效果圖:
參考文獻(xiàn):
https://blog.csdn.net/zhang24qin/article/details/41378627
https://blog.csdn.net/wr132/article/details/76093911
https://blog.csdn.net/liugh1974/article/details/83296182
總結(jié)
以上是生活随笔為你收集整理的macOS Mojave下解决wine中文乱码问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: h5 nan_h5页面在不同ios设备上
- 下一篇: 数据库:MySQL高频面试题,大厂必备!