解决VS2008中日文代码注释乱码的问题

1. 问题描述

开发对日软件外包业务时,开发计算机安装的操作系统一般为日文操作系统。但日常办公的计算机中安装的是中文操作系统,对于日文软件和代码里的注释显示的都是乱码。显然软件在制作时没有考虑多国语言的问题。有时业务繁忙时,会将工作带回家作业,不可避免遇到了日文软件无法使用,以及日文代码注释显示乱码的问题。

2. 系统环境

操作系统:

  • windows XP SP3
  • Windows 7

开发工具:

  • VS2008 sp1

3. 解决办法

3.1. 操作系统安装多国语言包

在控制面板中修改区域语言选项中:“Lanuage for non-unicode programs”的语言选择日文 ;

修改VS2008中"tools"->"options"->"fonts and colors"的“text Edit”字体为MS UI Gothic。

该方法缺点:系统中的原中文软件显示都是乱码,即无法使用操作系统中的中文软件。

3.2. 使用支持多国语言的软件

使用Microsoft AppLocale在VS2008英文版中正常显示日文注释。

3.2.1. What is AppLocale 

微软给出的AppLocale的说明:

Unicode based platforms, such as Windows XP, emulate the language environment required to run non-Unicode applications by internally converting application's non-Unicode text data to Unicode using a system-wide variable commonly called the system local (or language for non-Unicode applications). The language of the non-Unicode applications should be of the same script or family as the one defined by the system locale. Failing to meet this condition results in display of garbage characters in the UI of the application.

This approach has few usability limitations:

- Only an administrator has the ability of setting the system locale value.

- Setting the system locale requires a system reboot.

- Only one system locale can be set at a time.

AppLocale (or Application Locale) is a temporary solution to these limitations caused by non-Unicode applications running on the Unicode (UTF-16) based Windows XP. AppLocale detects the language of the legacy application and simulates a corresponding system locale for code-page to/from Unicode conversions.

3.2.2. AppLocale 的使用方法

以Windoows7为例说明AppLocale的使用方法

i. 打开Microsoft AppLocale向导

clip_image001[4]

ii. 选择启动的应用程序

clip_image002[4]

clip_image004[4]

iii. 选择应用程序显示的语言

clip_image005[4]

iv. 创建启动快捷方式

clip_image006[4]

你可能感兴趣的:(vs2008)