lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev UCSetTransParams() mystery...


From: Klaus Weide
Subject: Re: lynx-dev UCSetTransParams() mystery...
Date: Wed, 13 Jan 1999 21:12:16 -0600 (CST)

On Thu, 14 Jan 1999, Leonid Pauzner wrote:

> I was trying to remove this annoying "me->tag_charset:" from trace log,
> but apparently "UCSetTransParams:" show an incorrect charset handler:
> windows-1251 is 24  and cp866 is 23.
> E.g., we hold different handlers for the same charset
> (say cp866:  UChndl=17 and UCLYhndl=23  (sic!)
> Yes, it "works" but looks too messy to say at least.

Every occurrence of "UChndl" (without any "LY") should designate a
different kind of handle than the ones used throughout the rest of the
code: the "UChndl"s should only be used internally in UCdomap.c, the
rest of the Lynx code shouldn't have to know anything about those
numbers and should regard their values as an internal implementation
detail.

So I think you created your onw confusion, by generating TRACE output
that shows those numbers without clearly saying what they are.  (I
assume you inserted the TRACE statement in UCSetTransParams.)

The fact that the tables filled in from the *.tbl files use a different
kind of number internally from how the rest of lynx addresses character
sets may be confusing, but it allows for flexibility: There can be
character sets defined in LYCharSets.c that don't have a corresponding
.tbl file and vice versa; or at least that used to be the case.

I admit that the choice of the variable (or struc element) name may be
confusing, so here's the rule again, as I am thinking of it: Everything
that's called "UChndl" is the internal numbering; everything else,
whether it looks similar (UCLYhndl) or not (current_char_set, tag_charset,
...), refers to the "usual" numbering.


> SGML: Start <META>
> me->tag_charset: 38 -> 38 (me->UCLYhndl: 23, tag_charset: 38)
>                                ^^^^^^^^^^^^
> LYHandleMETA: HTTP-EQUIV="Content-Type" NAME="NULL" CONTENT="text/html; 
> charset=windows-1251"
> UCSetTransParams: from windows-1251(18) to cp866(17)
>     ^^ which is:                           ^^^^^^^^^
>     CTRACE(tfp, "UCSetTransParams: from %s(%d) to %s(%d)\n",
>            p_in->MIMEname, p_in->UChndl, p_out->MIMEname, p_out->UChndl);
> 
> LYHandleMETA: New charset: windows-1251
> SGML: Start <HTML>
> me->tag_charset: 38 -> 38 (me->UCLYhndl: 23, tag_charset: 38)
> HTML:begin_element[0]: adding style to stack - Normal
> SGML: Start <HEAD>
> me->tag_charset: 38 -> 38 (me->UCLYhndl: 23, tag_charset: 38)


    Klaus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]