HighTechTalks DotNet Forums  

Garbled text in managed textbox on MFC native dialog (C++/CLI)

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss Garbled text in managed textbox on MFC native dialog (C++/CLI) in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Igor Gassko
 
Posts: n/a

Default Garbled text in managed textbox on MFC native dialog (C++/CLI) - 09-13-2006 , 09:42 AM






I would appreciate help on the following problem:

I work on Visual Studio 2005 (.NET 2, MFC 8). My OS is Windows XP with
Hebrew MUI installed. OS UI language is English, default language
for-non Unicode programs is Hebrew (ANSI codepage 1255).

I've got solution containing two projects:
+ C++ MFC executable compiled with /clr switch and ANSI character set
+ C# control library

I've created MFC dialog and placed on it managed control from the C#
library, which contains textbox. In addition, I've created plain
textbox (CEdit) and placed it on the MFC dialog as well.

When I try to type Hebrew text into the managed textbox, it displays
characters from codepage 1252 (Wester Europe) instead of 1255 (Hebrew),
that is, the text appears garbled. However, when I set the content of
the managed textbox via code, Hebrew text is displayed properly. When I
type Hebrew text into the native textbox, it is displayed normally as
well.

I've checked the relevant properties of
System.Globalization.CultureInfo and they seem to be OK:
CurrentCulture has value {he-IL}
CurrentUICulture has value {en-US}
InstalledUICulture has value {en-US}

System.Globalization.CultureInfo.CurrentCulture.Te xtInfo.ANSICOdePage
is 1255
System.Globalization.CultureInfo.CurrentUICulture. TextInfo.ANSICOdePage
is 1252

When I change my OS UI language to Hebrew, CurrentUICulture becomes
{he-IL}, however, typed Hebrew text in managed textbox still appears
garbled.

When C++ project is compiled with Unicode character set, typed Hebrew
text in managed textbox is displayed properly and everything seems to
be OK.

I wonder if there is some way to correct this behavior via project
settings or code, other than switching the C++ project into Unicode (my
C++ project cannot be converted into Unicode at this moment).


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.