Cannot get NLS to work

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Cannot get NLS to work

Postby jduff » Tue May 04, 2010 3:22 pm

I'm having a hard time finding out why I can't get our UIs to properly handle some European code pages: Czech & Greek for example.
This is the first time we've attempted to support anything outside of ISO-8859-1 (Western Europe). At this point, we're not externalizing messages or anything like that. We just want to be able to have our users enter Czech and Greek characters into entry fields.

I know that I have my Windows regional settings correct (XP) because inspecting
Code: Select all
Locale current
shows

Locale(czech-czechoslovakia)
platformStringIndex = 1
platformStringClass = String
language = 'czech'
territory = 'czechoslovakia'
countryAbbreviation = 'CS'
platformId = '5,1,1029,1029'
codeSet = ''
keyboard = ''


The problem I'm focusing on is that we have our entry fields set to uppercase. When tabbing out of the entry fields, it is uppercasing but to wrong values. I've looked at the converter/helper code and it simply calls String>>asUppercase to do the core of it's work.
The core of that method is essentially:
Code: Select all
LCCType default asUppercase: (Character value: 233)



'ěščřžýáíé' asUppercase ===> 'EŠCRŽÝÁÍÉ'
'ěščřžýáíé' asByteArray ===> [101 154 99 114 158 253 225 237 233]


So, asByteArray isn't giving me what I expect. An "e with a caron" (ě) is supposed to be 236, but the byte array shows 101. Even then, executing the code

Code: Select all
LCCType default asUppercase: (Character value: 236)


just returns the same value, instead of the upper case value.

It looks like I'm still getting ISO-8859-1 because if I inspect
Code: Select all
Character value: 236
I see ì instead of ě.


Thanks in advance!
jduff
 
Posts: 15
Joined: Wed Jan 02, 2008 8:59 am

Re: Cannot get NLS to work

Postby tc » Sat May 08, 2010 2:35 am

Hello,

If you open Notepad, hold down the alt key, enter 236, release the alt key, what character do you see?

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Re: Cannot get NLS to work

Postby jduff » Tue May 25, 2010 10:34 am

I've resolved some of my problems. I found out that
Code: Select all
Locale current
reports Locale(czech-czechoslovakia) even when the only change in the "Regional and Language Options" in Windows was on the Regional Options tab. HOWEVER, you also have to go to the Advanced tab and set Czech as the language there. I didn't know that.

So, now I'm just trying to get my head wrapped around Windows 1250 codepage vs. ISO-8859-2. Can someone validate my following assertions?... :?:

Based upon Marten's post here re: UTF-8 http://www.instantiations.com/forum/viewtopic.php?f=12&t=3294&p=13151&hilit=UTF#p13151 that if I want to use a UTF-8 database, I'm still going to need to convert from the user's codepage to UTF-8 and back again. Is this correct?

Also, I feel like there is something still wrong in my setup that I can't figure out with the "current code page". I would expect
Code: Select all
AbtCodePageConverter currentCodePage
to return 1250 (windows central european) but I always get (IBM) 819 which is iso8859-1 (western european).
That method seems to be implemented based upon the font I have installed and falls through to some default code. My font reports the codepage as 'microsoft-other' and I don't see any way around that.

For what it is worth, I found the Window Registry setting for current code page is
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage @ ACP = 1250
jduff
 
Posts: 15
Joined: Wed Jan 02, 2008 8:59 am

Re: Cannot get NLS to work

Postby jduff » Tue May 25, 2010 11:57 am

BTW, the font name that comes back from CgDisplay default defaultFontStruct name is:

-microsoft-system-bold-r-normal-sans serif-13-100-96-96-p-70-microsoft-other


I can't find documentation explaining why that would be and where I can set that to something else.

EtWindow fontList name returns:
-microsoft-arial ce-medium-r-normal-sans serif-19-140-96-96-p-0-microsoft-other
jduff
 
Posts: 15
Joined: Wed Jan 02, 2008 8:59 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest