lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev chartrans broken with SOURCE_CHACHE


From: Leonid Pauzner
Subject: Re: lynx-dev chartrans broken with SOURCE_CHACHE
Date: Sat, 3 Jul 1999 15:36:32 +0400 (MSD)

27-Jun-99 13:54 Klaus Weide wrote:

> 1. Display character set (as saved in .lynxrc is 'Western (ISO-8859-1)'.
> 2. Start lynx as

>      lynx http://www.cogsci.ed.ac.uk/~richard/unicode-sample.html

> 3. Check that things look right, especially in the 'Latin-1 Supplement'
>    block.

> 4. Go to 'O'ptions screen, change display character set to
>    '7 bit approximations (US-ASCII)'.   (I used the old style Options
>    Menu, in case it matters.)

> 5. Look at 'Latin-1 Supplement' block.
>    a. If SOURCE_CACHE was none, everything is ok.
>    b. If SOURCE_CACHE was FILE or MEMORY, 8-bit characters are still shown
>       directly.

This quick fix solve the problem.
[The *proper* way should be rewriting all UCStages logic from scratch.
BTW, if you change display charset while looking the document with META tag
(like the URL to sample) in _source_ mode you lost `assumed' charset
with/without SOURCE_CACHE and with/without prettysrc mode.]


* SOURCE_CACHE: fix updating the document when "display charset" was changed
  from Options Menu by user: FREE(anchor->UCStages) call from
  HTuncache_current_document() now duplicated in HTreparse_document().
  (problem reported by KW) - LP.


diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Fri Jun 18 14:54:46 1999
+++ ./gridtext.c        Sat Jul  3 15:03:52 1999
@@ -451,6 +451,8 @@
     if (!self)
        return self;

+    CTRACE(tfp, "GridText: start HText_new\n");
+
 #if defined(VMS) && defined (VAXC) && !defined(__DECC)
     status = lib$stat_vm(&VMType, &VMTotal);
     CTRACE(tfp, "GridText: VMTotal = %d\n", VMTotal);
@@ -619,8 +621,6 @@
        self->last_lineno_last_disp_partial = -1;
 #endif

-    CTRACE(tfp, "GridText: start HText_new\n");
-
     return self;
 }

@@ -6174,6 +6174,14 @@
              HTMainAnchor->source_cache_file);

        /*
+        * This magic FREE(anchor->UCStages) call
+        * stolen from HTuncache_current_document() above.
+        */
+           if (!(HTOutputFormat && HTOutputFormat == WWW_SOURCE)) {
+               FREE(HTMainAnchor->UCStages);
+           }
+
+       /*
         * This is more or less copied out of HTLoadFile(), except we don't
         * get a content encoding.  This may be overkill.  -dsb
         */
@@ -6218,6 +6226,14 @@

        CTRACE(tfp, "Reparsing from source memory cache %p\n",
                    (void *)HTMainAnchor->source_cache_chunk);
+
+       /*
+        * This magic FREE(anchor->UCStages) call
+        * stolen from HTuncache_current_document() above.
+        */
+           if (!(HTOutputFormat && HTOutputFormat == WWW_SOURCE)) {
+               FREE(HTMainAnchor->UCStages);
+           }

        /*
         * This is only done to make things aligned with SOURCE_CACHE_NONE and




reply via email to

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