13和14对非英文字符的处理方式不同。
如果想用14,再和13的人交流的时候,会有很大问题的。
至于你的问题,请看
help unicode_advice
里面有提
You need to translate your .dta files, ado-files, and do-files if you
previously used extended ASCII to include accented characters, special
symbols, or non-Latin characters in your Stata files.
我也遇到类似的问题,Stata13的数据文件使用Stata14打开后,以前英文变量名称(例如,sex)的标签(例如,性别)显示为非法字符。我尝试使用如下方法:
第一步,先分析编码:
. unicode analyze 3_prod_try.dta
(Directory ./bak.stunicode created; please do not delete)
------------------------------------------------------------------------
Some elements of the file appear to be UTF-8 already. Sometimes elements that need translating can look like UTF-8. Look at these example(s):
value-label contents "1001--2000Ԫ"
Do they look okay to you?
If not, the file needs translating or retranslating with the transutf8 option. Type
. unicode translate "3_prod_try.dta", transutf8
. unicode retranslate "3_prod_try.dta", transutf8
------------------------------------------------------------------------
File needs translation. Use unicode translate on this file.
File 3_prod_try.dta needs translation // 提示需要转码
第二步,Unicode重编码。
官方说明是这样说的:我们需要对unicode进行重编码。
选择一种合适的的编码系统,这项工作让人退而却步(daunting),因为Stata约有230多种编码体系。如果旧版本的数据使用的是拉丁字母表(Latin alphabet),那么,编码体系可能是ISO-8859-1(称为latin1)或Windows-1252,这两者差不多一样。如果旧版本的数据基于Windows操作系统,那么,编码体系可能是Windows-1252。如果旧版本数据在互联网上公布,那么,编码体系可能是ISO-8859-1。如果旧版数据使用的是日文扩展的ASCII字符(Japanese Extended ASCII characters),编码体系可能是Shift_JIS、Windows-932、或EUC-JP(最后一个的可能性很小)。
对于以上编码体系,我们需要逐个去尝试,并通过Stata数据编辑器(Stata's Data Editor),或describe命令、codebook命令、或对变量做表分析(tabulate命令)以查看转换后的结果是否是我们所需要的。
如果以上变量都不是,我们还可以使用其他两种搜索方法。第一种是借助help文件功能。方法为:在Stata主菜单EditFind,在结果窗口和命令窗口之间就会多出一个查找工具条。在工具条中输入,例如“Chinese”,这样就可以在结果窗口中查找。
我分别按照上述方法逐个做了尝试,例如:
unicode encoding set Windows-1252
unico translat