Opened 17 years ago
Closed 17 years ago
#519 closed defect (fixed)
Mgserver.exe chrashes when "," is used as decimal separator in locale
Reported by: | trondat | Owned by: | tonyfang |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | Server | Version: | 2.0.0 |
Severity: | major | Keywords: | |
Cc: | External ID: |
Description
The mgserver.exe crashes when there is a locale setting using "," as decimal separator on a windows server. This is used in Norwegian locale.
To reproduce this change the locale to Norwegian ( verify that the decimal separator is ",") and set this as the default user setting.
run the mgserver.exe interactively ( mgserver.exe run) . It produces the following output :
Running the server interactively as an application instead of as a service.
(3032) Failed to retrieve message for "MgInvalidArgumentException".
[1] = "const string&"
Failed to retrieve message for "MgInvalidStringConversion". Exception occurred in method MgUtil.WideCharToMultiByte at line 297 in file d:\buildforgeprojects\mapguide_open_source_v2.0\build_23.8\mgdev\common\foundation\System/Util.cpp
(3032) Failed to retrieve message for "MgConnectionNotOpenException". Exception occurred in method MgSiteConnection.GetCurrentUserInfo at line 382 in file d:\buildforgeprojects\mapguide_open_source_v2.0\build_23.8\mgdev\common\mapguidecommon\System/UserInformation.cpp
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
Change History (3)
comment:1 by , 17 years ago
Owner: | set to |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The problem is actually with the locale name "Norwegian (Bokmål)_Norway.1252" and NOT the "," decimal separator.
In Windows, when ::setLocale is called, it is returning the name of the locale, "Norwegian (Bokmål)_Norway.1252", as a code-paged multi-byte string. However, MapGuide expects the string to be in UTF-8. Thus when it tries to convert it to a wide-string using a UTF8-to-UTF16 conversion method, it throws an exception -- which crashes the server.
Since we aren't doing anything meaningful with that locale string anyways (we're just outputting it in a debug message), we can simply remove the code which attempts to convert that string to a wide-string.