Certain code functions may not behave as expected when you use Unicode information in Visual C++

Article translations Article translations
Article ID: 937465 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

Consider the following scenario. You try to use certain code functions together with Unicode information in an application. The application was built by using Microsoft Visual C++. In this scenario, the functions may not behave as expected. Additionally, the functions may behave differently in an application that is built by using Microsoft Visual Studio .NET 2003 than they do in an application that is built by using Visual Studio 2005. For example, when you try to use the fstream.open function to open a file stream by using Visual Studio 2005, the function may not work. Additionally, the file stream may not be opened.

CAUSE

This problem occurs because Unicode information is handled differently in Visual Studio 2005 than it is in Visual Studio .NET 2003. Visual Studio 2005 provides better support for Unicode information. However, you must specify the locale to use when you work with Unicode information in Visual Studio 2005.

RESOLUTION

To resolve this problem, call the setlocale function to set the locale for the application. You must do this before you call the function that uses Unicode information. For example, add the following line of code to the application to use the Japanese locale.
std::locale::global(std::locale("japanese"));

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Properties

Article ID: 937465 - Last Review: June 21, 2007 - Revision: 1.0
APPLIES TO
  • Microsoft Visual Studio 2005 Express Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Standard 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 Foundation
  • Microsoft Visual Studio 2005 Team System Test Edition
Keywords: 
kbcode kbbug kbexpertiseinter kbexpertisebeginner kbtshoot kbprb KB937465

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com