Microsoft KB Archive/927753

= FIX: Japanese characters cannot be displayed when you use the std::cout command in the Japanese version of Windows XP x64 Edition =

Article ID: 927753

Article Last Modified on 7/23/2007

-

APPLIES TO


 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Express Edition
 * Microsoft Visual Studio 2005 Team Edition for Database Professionals
 * Microsoft Visual Studio 2005 Team Edition for Software Architects
 * Microsoft Visual Studio 2005 Team Edition for Software Developers
 * Microsoft Visual Studio 2005 Team Edition for Software Testers
 * Microsoft Visual Studio 2005 Team Foundation Server
 * Microsoft Visual Studio 2005 Team Suite
 * Microsoft Visual Studio 2005 Team System Test Edition

-



SYMPTOMS
Consider the following scenario. In the Japanese version of Microsoft Windows XP x64 Edition, you have a Microsoft Visual C++ 2005 application. You use the std::cout command to display some Japanese characters in the application. You use the setlocale(LC_ALL, &quot;&quot;) function or the setlocale(LC_ALL, &quot;Japanese&quot;) function together with the std::cout command. In this scenario, the Japanese characters cannot be displayed.



Hotfix information
A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites
You must have the release version of Visual Studio 2005 installed to apply this hotfix.

Restart requirement
You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other hotfixes.

File information
The Japanese version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.



WORKAROUND
To work around this problem, use one of the following methods.

Method 1
Create a buffer for the stdout pointer and for the stderr pointer. Therefore, the application does not call the _write function byte by byte. For example, you can use the following sample code to create a buffer for the stdout pointer. char* ret = setlocale(LC_ALL, &quot;Japanese&quot;); setvbuf(stdout, NULL,_IOFBF, SIZE); std::cout << &quot;?&quot; << std::endl;

Method 2
Call the setlocale(LC_ALL, &quot;C&quot;) function before you use the std::cout command. For example, use the following sample code to call the setlocale(LC_ALL, &quot;C&quot;) function. char* ret = setlocale(LC_ALL, &quot;C&quot;); std::cout << &quot;?&quot; << std::endl; setlocale(LC_ALL,ret);



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
For more information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Keywords: kbexpertiseadvanced kbfix kbpubtypekc kbqfe kbhotfixserver KB927753

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.