HTML rendering issue

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

HTML rendering issue

Postby daswartz » Wed Nov 29, 2006 5:47 am

There are two (that I am aware of) methods for rendering HTML in VAST: the Web Connection rendering code and the Sst rendering code. Neither of the special character entity rendering tables for these two sets of code have been updated to include current HTML character entities. The Web Connect table is much more complete than the Sst table.

Specifically, I ran into the fact that neither table includes support for the Euro currency symbol.

To fix them individually:

Add the line:
at: 164 put: '€';
to AbtHtmlCompatibilityCharacterTranslator class>>allCharacterEntityMappings.

Add the line:
at: (Character value: 164) put: '€';
to #SstHttpCommunications class>>setupHtmlSpecialCharacterMap.

Beware, this code will not correctly work on MVS or Z390 because, on that platform, the decimal value of the Euro symbol is completely dependant on which codepage is being used!

For a better answer than the fix I've posted above, refactor the two sets of code into one and add all the character entities which have been introduced since 1999.

Doug Swartz
daswartz
 
Posts: 48
Joined: Sat Oct 21, 2006 8:12 am
Location: Omaha, USA

Postby daswartz » Wed Nov 29, 2006 7:43 am

Also:

Add the line:
at: 164 put: '€';
to AbtHtmlCompatibilityCharacterTranslator class>>basicCharacterEntityMappings.

Doug Swartz
daswartz
 
Posts: 48
Joined: Sat Oct 21, 2006 8:12 am
Location: Omaha, USA

Postby tc » Sun Dec 10, 2006 1:38 am

Hi Doug,

Thanks for the post and the suggestion.

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

Postby tc » Wed Jan 17, 2007 1:26 pm

Hello,

My turn to ask a question, I switched my PC to a German locale and switched fonts. It seems the euro symbol is at 120 decimal (80 hex), but your post had 164.

Should I use 120 or 164?

Thanks.

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

Postby marten » Thu Jan 18, 2007 12:02 am

tc wrote:Hello,

My turn to ask a question, I switched my PC to a German locale and switched fonts. It seems the euro symbol is at 120 decimal (80 hex), but your post had 164.

Should I use 120 or 164?

Thanks.

--tc


That depends on the codepage the programmer uses to render its page (and defines this in its HTML page ..)

- Unicode / UTF-8 - 20AC hex (8364)
- ISO 8859-15/16 - A4 hex (164)
- CP1252 (Windows Latin-1) - 80 hex (128)

Marten
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Postby tc » Thu Jan 18, 2007 9:22 am

Hello,

I take it that ISO is the most common but when (and why) would one use other code pages?

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

Postby marten » Thu Jan 18, 2007 10:01 pm

tc wrote:Hello,

I take it that ISO is the most common but when (and why) would one use other code pages?

--tc


In case of UTF-8 it is clear: it covers all other cases.

In case of CP1252: well its Windows and that is enough for lots of solutions (and all editors out there).

Marten
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest