lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV InfoPage details...


From: Leonid Pauzner
Subject: LYNX-DEV InfoPage details...
Date: Wed, 11 Mar 1998 12:58:53 +0300 (MSK)

This is a proposed patch for LYShowInfo.c
to increase information for assumed charset:
if no 8-bit characters found - write "us-ascii (in fact)".

Leonid.



diff -u old/lyshowin.c ./lyshowin.c
--- old/lyshowin.c      Fri Feb 27 10:25:08 1998
+++ ./lyshowin.c        Wed Mar 11 12:45:10 1998
@@ -11,6 +11,7 @@
 #include "LYShowInfo.h"
 #include "LYSignal.h"
 #include "LYCharUtils.h"
+#include "LYCharSets.h"  /* for LYHaveCJKCharacterSet */
 #include "GridText.h"

 #include "LYLeaks.h"
@@ -256,6 +257,19 @@
         fprintf(fp0, "<dt><em>&nbsp;Charset:</em> %s\n",
                     HTLoadedDocumentCharset());
     } else {
+    /* assumed charset...  respectively from:
+     * <a charset=  href=  >, assume_local_charset, or assume_charset
+     *
+     * hack: if the document has only 7-bit characters
+     * ???but assume_charset!=0... ??? we write "us-ascii (in fact)"
+     * Note, we may check for 8-bit chars only in the rendered document
+     * but not in the remote source; so this check may be more strict
+     * because of &copy; etc.
+     */
+      if (!(HTLoadedDocumentEightbit() || LYHaveCJKCharacterSet))
+        fprintf(fp0, "<dt><em>&nbsp;Charset:</em> us-ascii (in fact)\n");
+      else
+      {
       LYUCcharset * p_in = HTAnchor_getUCInfoStage(HTMainAnchor,
                                                              UCT_STAGE_PARSER);
       if (!p_in || !(p_in->MIMEname) || !*(p_in->MIMEname) ||
@@ -266,6 +280,7 @@
          HTAnchor_getUCLYhndl(HTMainAnchor, UCT_STAGE_MIME) >= 0) {
         fprintf(fp0, "<dt><em>&nbsp;Charset:</em> %s (assumed)\n",
                     p_in->MIMEname);
+      }
       }
     }

reply via email to

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