[aida] AIDASite class>>isOldEncoding:

Janko Mivšek janko.mivsek at eranova.si
Fri Jun 1 11:26:09 CEST 2007


Hi Stefan,

Stefan Schmiedl wrote:
  >> I spent a few hours on my project today, and all I can say is that
>> AIDASite class>>isOldEncoding: is *evil* if you feed it German text.
>> More on this in a separate post later.
> 
> After I managed to find my way around the EXDI for ODBC, I had a list
> of employees on my hands, which should be displayed in a table. So I
> follow the approach of the tutorial. The list comes up on the first
> try. Good.

And you probably already take care that you convert to pure Unicode from 
your database into Smalltalk objects?


> But there is a slight cosmetic problem, the name "Günter" is displayed
> as "G?nter" with the special glyph that firefox uses for encoding
> problems.
> 
> As an additional data point I added a WebText "Überstunden" (overtime)
> which was printed correctly. Then I started to look at how VW/ODBC
> handle different encodings. Then I noticed that "Jörg" was actually
> printed as "Jörg"... what's happening here?
> 
> Good thing that the debugger can single step ... but even so it took me
> a while to locate the culprit. isOldEncoding compares the character
> codes against some values, of which $ü = 16r00FC is one, but $ö is not.
> So "Jörg" is not considered "old encoding" and correctly converted,
> while "Günter" is, hence is not.

AIDASite class>>isOldEncoding is a real relic from the past, back to 10
years ago in times of VW 2.5, which has some Xerox 16bit encoding instead
of Unicode. With VW 3.0 an Unicode was introduced and a real mess 
begins. That method was meant to ease mess a bit ..

Solution:

Just delete first line in method
AIDASite class>>convert:toCodepage:

(self inOldEncoding: aString) ifTrue: [^self oldconvert: aString 
toCodepage: aSymbol].

I already did and also removed all those "old" methods. That will show 
up in a next release of Aida.

Best regards
Janko


-- 
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si


More information about the Aida mailing list