FIX: When you call the WideCharToMultiByte function to enable your application to use the GB18030 data converter in Windows CE .NET 4.2, the return value of the function may be incorrect

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

On This Page


In Microsoft Windows CE .NET 4.2, you call the WideCharToMultiByte function to enable your application to use the GB18030 data converter. However, the return value of the function may be incorrect. This problem occurs when the following conditions are true:
  • The CodePage parameter of the function is set to 54936.
  • The cchWideChar parameter of the function is set to -1.


This problem occurs because the NULL termination character of the string is ignored if the cchWideChar parameter is set to -1.


Software update information

A supported software update is now available from Microsoft as Windows CE .NET 4.2 Platform Builder Monthly Update (September 2008). You can confirm this by scrolling to the "File information" section of this article. The package file name contains the product version, date, Knowledge Base article number, and processor type. The package file name format is:
Product version-yymmdd-kbnnnnnn-processor type
For example: Wincepb50-060503-kb917590-armv4i.msi is the ARMV4i Windows CE 5.0 Platform Builder fix that is documented in KB article 917590 and that is contained in the May 2006 monthly update. To resolve this problem immediately, click the following article number for information about obtaining Windows CE Platform Builder and core operating system software updates:
837392 How to locate core operating system fixes for Microsoft Windows CE Platform Builder products


This update is supported only if all previously issued updates for this product have also been installed.

Restart requirement

After you apply this software update, you must perform a clean build of the whole platform. To clean the platform, click Clean on the Build menu. To build the platform, click Build Platform on the Build menu.

You do not have to restart the computer after you apply this software update.

Update replacement information

This update does not replace any other updates.

File information

The English version of this software update package has the file attributes or the later file attributes that are listed in the following table.

Collapse this tableExpand this table
File nameFile sizeDateTime
Wincepb42-080911-kb957304- armv4.msi7,685,63211-Sep-200822:08
Wincepb42-080911-kb957304- armv4i.msi7,685,63211-Sep-200822:08
Wincepb42-080911-kb957304- mipsii.msi7,686,14411-Sep-200822:08
Wincepb42-080911-kb957304- mipsii_fp.msi7,686,65611-Sep-200822:08
Wincepb42-080911-kb957304- mipsiv.msi7,687,16811-Sep-200822:08
Wincepb42-080911-kb957304- mipsiv_fp.msi7,687,16811-Sep-200822:08
Wincepb42-080911-kb957304- sh3.msi7,684,09611-Sep-200822:08
Wincepb42-080911-kb957304- sh4.msi7,684,09611-Sep-200822:08
Wincepb42-080911-kb957304- x86.msi7,682,56011-Sep-200822:08

The English version of this software update package 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.
Collapse this tableExpand this table
File nameFile sizeDateTimePath
Gb18030.lib246,65029-Aug- 200823:28\public\common\oak\lib\armv4\debug
Gb18030.lib241,85629-Aug- 200823:28\public\common\oak\lib\armv4\retail
Gb18030.lib246,68429-Aug- 200823:28\public\common\oak\lib\armv4i\debug
Gb18030.lib241,88429-Aug- 200823:28\public\common\oak\lib\armv4i\retail
Gb18030.lib245,57029-Aug- 200823:29\public\common\oak\lib\mipsii\debug
Gb18030.lib242,59829-Aug- 200823:28\public\common\oak\lib\mipsii\retail
Gb18030.lib245,59029-Aug- 200823:29\public\common\oak\lib\mipsii_fp\debug
Gb18030.lib242,61029-Aug- 200823:29\public\common\oak\lib\mipsii_fp\retail
Gb18030.lib246,11029-Aug- 200823:29\public\common\oak\lib\mipsiv\debug
Gb18030.lib243,26429-Aug- 200823:29\public\common\oak\lib\mipsiv\retail
Gb18030.lib246,13029-Aug- 200823:29\public\common\oak\lib\mipsiv_fp\debug
Gb18030.lib243,27629-Aug- 200823:29\public\common\oak\lib\mipsiv_fp\retail
Gb18030.lib242,09829-Aug- 200823:29\public\common\oak\lib\sh3\debug
Gb18030.lib238,98629-Aug- 200823:29\public\common\oak\lib\sh3\retail
Gb18030.lib242,09829-Aug- 200823:29\public\common\oak\lib\sh4\debug
Gb18030.lib238,96229-Aug- 200823:29\public\common\oak\lib\sh4\retail
Gb18030.lib240,52029-Aug- 200823:28\public\common\oak\lib\x86\debug
Gb18030.lib237,72229-Aug- 200823:28\public\common\oak\lib\x86\retail


To work around this problem, follow these steps:
  1. Calculate the length of the character string. To do this, call the strlen function before you call the WideCharToMultiByte function.
  2. Add 1 to the value that you obtained in step 1.
  3. Set the sum that you obtained in step 2 as the value of the cchWideChar parameter of WideCharToMultiByte function. Use this value instead of -1.


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


For more information about the GB18030 data converter, visit the following Microsoft Developer Network Web site:
For more information about software update terminology, 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


Article ID: 957304 - Last Review: September 26, 2008 - Revision: 1.0
  • Microsoft Windows CE .NET 4.2
kbfix kbexpertiseadvanced kbqfe KB957304

Give Feedback


Contact us for more help

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