A bug in MSDN 2005

原创 2007年09月12日 10:55:00

Recently when I am programming using Visual C++, I referenced to MSDN 2005. However, when looking up `_mbsinc' and `_mbcdec', I found a bug in MSDN 2005.

In MSDN 2005, the _mbsinc topic contains:

..._mbsinc recognizes multibyte-character sequences according to the multibyte code page currently in use...

Note that MSDN says it uses the current multibyte code page. However in the _mbsdec topic:

The output value is affected by the setting of the LC_CTYPE category setting of the locale; see setlocale for more information. _mbsdec recognizes multibyte-character sequences according to the local currently in use

Note in the above description, firstly, it says the "local" currently in use. It's a typo which should be "locale". Second, the current locale is _different_ from the the current multibyte code page. The current multibyte code page, which can be set in the Control Panel, is usually 936 on Simplified Chinese Windows systems. The current locale, however, is often set to a western one (may be "C") by default.

In MSDN 2005, there is another topic named "Locale". You can find it by typing "setlocale" in Index and look for "Locale" in the index results. Now in that page you can see that _mbsinc and _mbsdec are not listed in the table. It means that they both use the current multibyte code page rather than the current locale.

So it is a bug in MSDN 2005.

I don't know how Borland C++ Compiler 5.5 deals with locales. But as I observe, its mblen function uses the current multibyte code page. It is also possible that the default locale is set to the current multibyte code page, however it is not proven.

New: 20070912 22:01, after my testing, I confirmed that Borland _mbclen and mblen both use the locale, and the locale is set to the system default when the program is up and running.

相关文章推荐

Refactoring C# Code Using Visual Studio 2005 ----MSDN

Refactoring C# Code Using Visual Studio 2005             Visual Studio 2005 Andrew W. Troe...

SQL Server 2005 中的分区表和索引 --MSDN

SQL Server 2005 中的分区表和索引 SQL Server 2005 发布日期 : 3/24/2005 | 更新日期 : 3/24/2005 Kimberl...

转自MSDN: Visual Studio 2005:在 Visual C++ 中开发自定义的绘图控件

Visual Studio 2005:在 Visual C++ 中开发自定义的绘图控件Visual Studio 2005发布日期 : 2006-4-14 | 更新日期 : 2006-4-14Tom ...
  • guo693
  • guo693
  • 2011年04月21日 00:56
  • 607

LNK1106 microsoft msdn vs.net bug 临时解决方案

FIX: 您收到一个"LNK1106: 无效的文件或磁盘已满"生成在 Visual c + +.net 项目时出现错误消息要变通解决此问题,添加 /IGNOREIDL 链接器选项。 在 Visual...
  • lionzl
  • lionzl
  • 2011年01月05日 11:32
  • 708

MSDN2005绿色便携版之二

  • 2014年03月20日 00:00
  • 79.32MB
  • 下载

VS2005中派生模板类的BUG

一般来说犯错误的都是开发者.VS的错误还是蛮少的.额..除了预编译头有时候会错误要Clean一下. 今天确实遇到了一个bug.查了半天.又写了好些测试代码.才把错误模型整理出来. 发现是在存在虚函...
  • ainn_pp
  • ainn_pp
  • 2011年10月11日 18:12
  • 607

Sqlserver2005 peer-to-peer事务复制(对等拓扑复制)的Bug及其配置简述

Sqlserver2005 peer-to-peer事务复制(对等拓扑复制)的Bug及其配置简述Sqlserver2009-08-01 17:32:22阅读55评论0  字号:大中小 订阅主要就是几点...
  • zhongqi
  • zhongqi
  • 2011年03月09日 22:40
  • 648
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:A bug in MSDN 2005
举报原因:
原因补充:

(最多只允许输入30个字)