stata15中文乱码处理——转自连玉君老师码云


1. ua 命令

适用于 stata15 用户。可以一次性对当前工作路径以及所有子文件夹中的文件进行转码(unicode),以保证中文字符可以正常显示。

安装

下载 ua.ado 和 ua.hlp,放置于 D:\stata15\ado\base\u 或 D:\stata15\ado\plus\u 文件夹中。

使用

  • 在 Stata 命令窗口中输入 help ua,查看命令介绍和 Stata 范例。参照范例使用即可。

Stata 范例


 * Change current working directory (CWD)  . cd D:\stata15\ado\personal\mypaper   * Unicode all .dta files in CWD and files in sub-directories  . ua: unicode encoding set gb18030  . ua: unicode translate *.dta   * Unicode all files (.do, .ado, .dta, .hlp, etc.) in CWD and files in sub-directories  . ua: unicode encoding set gb18030  . ua: unicode translate * 

2. uall 命令

Description

uall is shortcut for help ua.

It executes the following two commands:

  . ua: unicode encoding set gb18030
 . ua: unicode translate *

Syntax

  • Short version (Chinese only):
     . uall
  • Full version:
     . uall [encoding-name]
  • encoding-name is the name of encoding, see the list of encodings.
  • The default is gb18030 for Chinese. So, for Chinese user, you need not specify this option.

Examples

  * Change current working directory (CWD)
 . cd D:\stata15\ado\personal\mypaper   * For Chinese users:  . uall   * For Japnese users:  . uall ibm-943_P15A-2003   * For Korean users:  . uall ibm-970_P110_P110-2006_U2

Author


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM