diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1997-09-12 09:32:20 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1997-09-12 09:32:20 -0400 |
commit | 2f5222ea2a4d549b4f269c11d34016fc7dc58dde (patch) | |
tree | a71f2059819076b2adf4922b25d7cbe7d217c3fe /src | |
parent | 549ec595d1da7693d5f7730e63f539cc8452307f (diff) | |
download | lynx-snapshots-2f5222ea2a4d549b4f269c11d34016fc7dc58dde.tar.gz |
snapshot of project "lynx", label v2-7-1ac_0-64
Diffstat (limited to 'src')
36 files changed, 772 insertions, 188 deletions
diff --git a/src/GridText.c b/src/GridText.c index e1c414d6..301d2a18 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -12,8 +12,6 @@ #include "HTTP.h" #include "HTAlert.h" #include "HTCJK.h" -#include "UCDefs.h" -#include "UCAux.h" #include <assert.h> #include <ctype.h> @@ -4487,6 +4485,7 @@ PUBLIC void print_wwwfile_to_fd ARGS2( fputc(line->data[i],fp); } else if (line->data[i] == LY_SOFT_HYPHEN && line->data[i + 1] == '\0') { /* last char on line */ +#ifdef EXP_CHARTRANS if (dump_output_immediately && LYRawMode && LYlowest_eightbit[current_char_set] <= 173 && @@ -4497,6 +4496,9 @@ PUBLIC void print_wwwfile_to_fd ARGS2( } else { fputc('-', fp); } +#else /* EXP_CHARTRANS */ + fputc('-', fp); +#endif /* EXP_CHARTRANS */ } else if (dump_output_immediately && use_underscore) { switch (line->data[i]) { case LY_UNDERLINE_START_CHAR: @@ -4563,6 +4565,7 @@ PUBLIC void print_crawl_to_fd ARGS3( fputc(line->data[i],fp); } else if (line->data[i] == LY_SOFT_HYPHEN && line->data[i + 1] == '\0') { /* last char on line */ +#ifdef EXP_CHARTRANS if (dump_output_immediately && LYRawMode && LYlowest_eightbit[current_char_set] <= 173 && @@ -4573,6 +4576,9 @@ PUBLIC void print_crawl_to_fd ARGS3( } else { fputc('-', fp); } +#else /* EXP_CHARTRANS */ + fputc('-', fp); +#endif /* EXP_CHARTRANS */ } } /* diff --git a/src/HTFWriter.c b/src/HTFWriter.c index e869eb73..a5dd12a5 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -243,10 +243,17 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me) * for local files. - KW */ if (!skip_loadfile) { + if (HTAnchor_getUCLYhndl(me->anchor, + UCT_STAGE_PARSER) < 0 ) { + /* If not yet set - kw */ + HTAnchor_copyUCInfoStage(me->anchor, + UCT_STAGE_PARSER, + UCT_STAGE_MIME, + UCT_SETBY_DEFAULT+1); + } HTAnchor_copyUCInfoStage(me->anchor, UCT_STAGE_PARSER, - UCT_STAGE_MIME, - UCT_SETBY_PARSER); + UCT_STAGE_MIME, -1); } #endif /* diff --git a/src/HTInit.c b/src/HTInit.c index db3a9225..9de4f24a 100644 --- a/src/HTInit.c +++ b/src/HTInit.c @@ -50,7 +50,8 @@ PUBLIC void HTFormatInit NOARGS #ifdef NeXT HTSetPresentation("application/postscript", "open %s", 1.0, 2.0, 0.0, 0); - HTSetPresentation("image/x-tiff", "open %s", 1.0, 2.0, 0.0, 0); + HTSetPresentation("image/x-tiff", "open %s", 2.0, 2.0, 0.0, 0); + HTSetPresentation("image/tiff", "open %s", 1.0, 2.0, 0.0, 0); HTSetPresentation("audio/basic", "open %s", 1.0, 2.0, 0.0, 0); HTSetPresentation("*", "open %s", 1.0, 0.0, 0.0, 0); #else @@ -118,7 +119,7 @@ PUBLIC void HTFormatInit NOARGS HTSetConversion("application/x-wais-source", "www/source", HTPlainPresent, 1.0, 0.0, 0.0, 0); HTSetConversion("application/x-wais-source", "www/present", - HTWSRCConvert, 1.0, 0.0, 0.0, 0); + HTWSRCConvert, 2.0, 0.0, 0.0, 0); HTSetConversion("application/x-wais-source", "www/download", HTWSRCConvert, 1.0, 0.0, 0.0, 0); HTSetConversion("application/x-wais-source", "www/dump", @@ -181,6 +182,14 @@ PUBLIC void HTFormatInit NOARGS } +PUBLIC void HTPreparsedFormatInit NOARGS +{ + if (LYPreparsedSource) { + HTSetConversion("text/html", "www/source", HTMLParsedPresent, 1.0, 0.0, 0.0, 0); + HTSetConversion("text/html", "www/dump", HTMLParsedPresent, 1.0, 0.0, 0.0, 0); + } +} + /* Some of the following is taken from: */ /* @@ -281,8 +290,7 @@ PRIVATE char *Cleanse ARGS1(char *,s) PRIVATE int ProcessMailcapEntry ARGS2(FILE *,fp, struct MailcapEntry *,mc) { int i, j; - size_t rawentryalloc = 2000; - size_t len; + size_t rawentryalloc = 2000, len; char *rawentry, *s, *t, *LineBuf; LineBuf = malloc(LINE_BUF_SIZE); diff --git a/src/HTML.c b/src/HTML.c index 839fccc4..1c59d7a5 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -409,46 +409,65 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s) HTChunkPuts(&me->math, s); break; - default: /* Free format text */ - { + default: /* Free format text? */ + if (!me->sp->style->freeFormat) { + /* + * If we are within a preformatted text style not caught + * by the cases above (HTML_PRE or similar may not be the + * last element pushed on the style stack). - kw + */ + HText_appendText(me->text, s); + break; + } else { CONST char *p = s; + char c; if (me->style_change) { - for (; *p && - ((*p == '\n') || (*p == ' ') || (*p == '\t')); p++) + for (; *p && ((*p == '\n') || (*p == '\r') || + (*p == ' ') || (*p == '\t')); p++) ; /* Ignore leaders */ if (!*p) return; UPDATE_STYLE; } for (; *p; p++) { + if (*p == 13 && p[1] != 10) { + /* + * Treat any '\r' which is not followed by '\n' + * as '\n', to account for macintosh lineend in + * ALT attributes etc. - kw + */ + c = '\n'; + } else { + c = *p; + } if (me->style_change) { - if ((*p == '\n') || (*p == ' ') || (*p == '\t')) + if ((c == '\n') || (c == ' ') || (c == '\t')) continue; /* Ignore it */ UPDATE_STYLE; } - if (*p == '\n') { + if (c == '\n') { if (me->in_word) { if (HText_getLastChar(me->text) != ' ') HText_appendCharacter(me->text, ' '); me->in_word = NO; } - } else if (*p == ' ' || *p == '\t') { + } else if (c == ' ' || c == '\t') { if (HText_getLastChar(me->text) != ' ') HText_appendCharacter(me->text, ' '); - } else if (*p == '\r') { + } else if (c == '\r') { /* ignore */ } else { - HText_appendCharacter(me->text, *p); + HText_appendCharacter(me->text, c); me->in_word = YES; } /* set the Last Character */ - if (*p == '\n' || *p == '\t') { + if (c == '\n' || c == '\t') { /* set it to a generic seperater */ HText_setLastChar(me->text, ' '); - } else if (*p == '\r' && + } else if (c == '\r' && HText_getLastChar(me->text) == ' ') { /* * \r's are ignored. In order to keep collapsing @@ -458,7 +477,7 @@ PUBLIC void HTML_put_string ARGS2(HTStructured *, me, CONST char *, s) */ HText_setLastChar(me->text, ' '); } else { - HText_setLastChar(me->text, *p); + HText_setLastChar(me->text, c); } } /* for */ @@ -7207,6 +7226,59 @@ PUBLIC HTStream* HTMLToPlain ARGS3( return SGML_new(&HTML_dtd, anchor, HTML_new(anchor, pres->rep_out, sink)); } +/* HTConverter for HTML source to plain text +** ----------------------------------------- +** +** This will preparse HTML and convert back to presentation or plain text. +*/ +PUBLIC HTStream* HTMLParsedPresent ARGS3( + HTPresentation *, pres, + HTParentAnchor *, anchor, + HTStream *, sink) +{ + HTStream * intermediate = sink; + if (!intermediate) { +#ifdef EXP_CHARTRANS + /* + * Trick to prevent HTPlainPresent from translating again. + * Temporarily change UCT_STAGE_PARSER setting in anchor + * while the HTPlain stream is initialized, so that HTPlain + * sees its input and output charsets as the same. - kw + */ + int old_parser_cset = HTAnchor_getUCLYhndl(anchor,UCT_STAGE_PARSER); + int structured_cset = HTAnchor_getUCLYhndl(anchor,UCT_STAGE_STRUCTURED); + if (structured_cset < 0) + structured_cset = HTAnchor_getUCLYhndl(anchor,UCT_STAGE_HTEXT); + if (structured_cset < 0) + structured_cset = current_char_set; + HTAnchor_setUCInfoStage(anchor, structured_cset, + UCT_STAGE_PARSER, UCT_SETBY_MIME); +#endif /* EXP_CHARTRANS */ + if (pres->rep_out == WWW_SOURCE) { +/* intermediate = HTPlainPresent(pres, anchor, NULL); */ + intermediate = HTStreamStack(WWW_PLAINTEXT, WWW_PRESENT, + NULL, anchor); + } else { + intermediate = HTStreamStack(WWW_PLAINTEXT, pres->rep_out, + NULL, anchor); + } +#ifdef EXP_CHARTRANS + if (old_parser_cset != structured_cset) { + HTAnchor_resetUCInfoStage(anchor, old_parser_cset, + UCT_STAGE_PARSER, UCT_SETBY_NONE); + if (old_parser_cset >= 0) { + HTAnchor_setUCInfoStage(anchor, old_parser_cset, + UCT_STAGE_PARSER, + UCT_SETBY_DEFAULT+1); + } + } +#endif /* EXP_CHARTRANS */ + } + if (!intermediate) + return NULL; + return SGML_new(&HTML_dtd, anchor, HTMLGenerator(intermediate)); +} + /* HTConverter for HTML to C code ** ------------------------------ ** diff --git a/src/HTML.h b/src/HTML.h index 0061f7d4..a19dcf4e 100644 --- a/src/HTML.h +++ b/src/HTML.h @@ -178,6 +178,11 @@ extern HTStream* HTMLToPlain PARAMS(( HTParentAnchor * anchor, HTStream * sink)); +extern HTStream* HTMLParsedPresent PARAMS(( + HTPresentation * pres, + HTParentAnchor * anchor, + HTStream * sink)); + extern HTStream* HTMLToC PARAMS(( HTPresentation * pres, HTParentAnchor * anchor, diff --git a/src/LYCgi.c b/src/LYCgi.c index c3658cae..3e825502 100644 --- a/src/LYCgi.c +++ b/src/LYCgi.c @@ -289,11 +289,11 @@ PRIVATE int LYLoadCGI ARGS4( int fd1[2], fd2[2]; char buf[1024]; pid_t pid; -#if defined(NeXT) || defined(AIX4) || defined(sony_news) +#if HAVE_TYPE_UNION_WAIT && !HAVE_WAITPID union wait wstatus; #else int wstatus; -#endif /* NeXT || AIX4 || sony_news */ +#endif /* Decode full HTTP response */ format_in = HTAtom_for("www/mime"); @@ -376,12 +376,12 @@ PRIVATE int LYLoadCGI ARGS4( (*target->isa->put_block)(target, buf, chars); } -#if defined(NeXT) || defined(AIX4) || defined(sony_news) +#if HAVE_TYPE_UNION_WAIT && !HAVE_WAITPID while (wait(&wstatus) != pid) ; /* do nothing */ #else waitpid(pid, &wstatus, 0); /* wait for child */ -#endif /* NeXT || AIX4 || sony_news */ +#endif if (anAnchor->post_data) { close(fd1[1]); } diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c index 14f2646c..678bbab8 100644 --- a/src/LYCharUtils.c +++ b/src/LYCharUtils.c @@ -1377,6 +1377,12 @@ PUBLIC char * LYUnEscapeEntities ARGS3( HTCJK != NOCJK)))) { *q++ = ' '; p++; + } else if (!hidden && *p == 10 && q != str && *(q-1) == 13) { + /* + * If this is not a hidden string, and the current char + * is the LF ('\n') of a CRLF pair, drop the CR ('\r'). - kw + */ + *(q-1) = *p++; } else { *q++ = *p++; } @@ -1999,7 +2005,7 @@ PUBLIC void LYHandleMETA ARGS4( UCT_STAGE_HTEXT, UCT_SETBY_DEFAULT); } - if (!(p_in->enc & UCT_ENC_CJK) && + if (p_in->enc != UCT_ENC_CJK && (p_in->codepoints & UCT_CP_SUBSETOF_LAT1)) { HTCJK = NOCJK; } else if (chndl == current_char_set) { @@ -2994,18 +3000,18 @@ PUBLIC void LYResetParagraphAlignment ARGS1( } PUBLIC BOOLEAN LYCheckForCSI ARGS2( - HTStructured *, me, + HTParentAnchor *, anchor, char **, url) { - if (!(me && me->node_anchor && me->node_anchor->address)) + if (!(anchor && anchor->address)) return FALSE; - if (strncasecomp(me->node_anchor->address, "file:", 5)) + if (strncasecomp(anchor->address, "file:", 5)) return FALSE; - if (!LYisLocalHost(me->node_anchor->address)) + if (!LYisLocalHost(anchor->address)) return FALSE; - StrAllocCopy(*url, me->node_anchor->address); + StrAllocCopy(*url, anchor->address); return TRUE; } diff --git a/src/LYCharUtils.h b/src/LYCharUtils.h index 55433d18..51c33962 100644 --- a/src/LYCharUtils.h +++ b/src/LYCharUtils.h @@ -85,7 +85,7 @@ extern void LYEnsureSingleSpace PARAMS(( extern void LYResetParagraphAlignment PARAMS(( HTStructured * me)); extern BOOLEAN LYCheckForCSI PARAMS(( - HTStructured * me, + HTParentAnchor * anchor, char ** url)); #endif /* Lynx_HTML_Handler */ diff --git a/src/LYCookie.c b/src/LYCookie.c index efed484c..67ddd131 100644 --- a/src/LYCookie.c +++ b/src/LYCookie.c @@ -521,7 +521,7 @@ PRIVATE char * scan_cookie_sublist ARGS6( if (TRACE && co) { fprintf(stderr, "Checking cookie %lx %s=%s\n", - (long) hl, + (long)hl, (co->name ? co->name : "(no name)"), (co->value ? co->value : "(no value)")); fprintf(stderr, "%s %s %i %s %s %i%s\n", @@ -1694,7 +1694,7 @@ PRIVATE void LYProcessSetCookies ARGS6( (co->value ? co->value : "[no value]")); if (co->expires > 0) { fprintf(stderr, " expires: %ld, %s\n", - (long) co->expires, + (long)co->expires, ctime(&co->expires)); } } diff --git a/src/LYCurses.c b/src/LYCurses.c index 808bb49d..e4a7718a 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -1599,8 +1599,9 @@ PUBLIC void lynx_start_link_color ARGS2( if (SLtt_Use_Ansi_Colors) start_underline (); #endif /* USE_SLANG */ -#if defined(FANCY_CURSES) - start_underline (); +#if defined(FANCY_CURSES) && defined(COLOR_CURSES) + if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) + start_underline (); #endif /* USE_SLANG */ } else { start_bold(); @@ -1626,8 +1627,9 @@ PUBLIC void lynx_stop_link_color ARGS2( if (SLtt_Use_Ansi_Colors) stop_underline (); #endif /* USE_SLANG */ -#if defined(FANCY_CURSES) - stop_underline (); +#if defined(FANCY_CURSES) && defined(COLOR_CURSES) + if (lynx_uses_color && LYShowColor >= SHOW_COLOR_ON) + stop_underline (); #endif /* USE_SLANG */ } else { stop_bold(); diff --git a/src/LYCurses.h b/src/LYCurses.h index 1246bd2e..1478cade 100644 --- a/src/LYCurses.h +++ b/src/LYCurses.h @@ -43,51 +43,37 @@ #define REDEFINE_CR #endif /* CR */ -#ifdef DOSPATH -# include "curses.h" -#else -#ifdef NCURSES -# ifdef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H # ifdef HAVE_NCURSES_H # include <ncurses.h> # else -# include <curses.h> +# ifdef HAVE_CURSESX_H +# include <cursesX.h> /* Ultrix */ +# else +# ifdef HAVE_JCURSES_H +# include <jcurses.h> /* sony_news */ +# else +# include <curses.h> /* default */ +# endif +# endif # endif -# ifdef wgetbkgd +# if defined(wgetbkgd) && !defined(getbkgd) # define getbkgd(w) wgetbkgd(w) /* workaround pre-1.9.9g bug */ # endif +# ifdef NCURSES extern void LYsubwindow PARAMS((WINDOW * param)); - -# else /* FIXME: remove this after configure script is complete */ -# ifndef HAVE_NCURSES_H -# include <ncurses/curses.h> -# else -# ifdef __NetBSD__ -# include <ncurses/ncurses.h> -# else -# include <ncurses.h> -# endif /* __NetBSD__ */ -# endif /* HAVE_CONFIG_H */ -# endif /* HAVE_NCURSES_H */ +# endif /* NCURSES */ #else -# ifdef ULTRIX -# include <cursesX.h> /* ultrix */ +# if defined(VMS) && defined(__GNUC__) +# include "LYGCurses.h" # else -# if defined(VMS) && defined(__GNUC__) -# include "LYGCurses.h" -# else -# if defined(sony_news) -# include "/usr/sony/include/jcurses.h" /* sony_news */ -# else -# include <curses.h> /* everything else */ -# endif /* sony_news */ -# endif /* VMS && __GNUC__ */ -# endif /* ULTRIX */ -#endif /* NCURSES */ -#endif /* DOSPATH */ +# include <curses.h> /* everything else */ +# endif /* VMS && __GNUC__ */ +#endif /* HAVE_CONFIG_H */ + #endif /* USE_SLANG */ diff --git a/src/LYGetFile.c b/src/LYGetFile.c index 917bb037..bea7d19a 100644 --- a/src/LYGetFile.c +++ b/src/LYGetFile.c @@ -712,6 +712,8 @@ Try_Redirected_URL: * Check for redirection. */ if (use_this_url_instead != NULL) { + char *pound; + if (!is_url(use_this_url_instead)) { /* * The server did not return a complete @@ -803,6 +805,24 @@ Try_Redirected_URL: FREE(use_this_url_instead); return(NULLFILE); } + if ((pound = strchr(doc->address, '#')) != NULL && + strchr(use_this_url_instead, '#') == NULL) { + /* + * Our requested URL had a fragment + * associated with it, and the redirection + * URL doesn't, so we'll append the fragment + * associated with the original request. If + * it's bogus for the redirection URL, we'll + * be positioned at the top of that document, + * so there's no harm done. - FM + */ + if (TRACE) { + fprintf(stderr, + "getfile: Adding fragment '%s' to redirection URL.\n", + pound); + } + StrAllocCat(use_this_url_instead, pound); + } if (TRACE) sleep(MessageSecs); _user_message(WWW_USING_MESSAGE, @@ -846,7 +866,7 @@ Try_Redirected_URL: { char *pound; /* - * Check for #selector. + * Check for a #fragment selector. */ pound = (char *)strchr(doc->address, '#'); diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index 584fe9eb..6ecc9211 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -323,6 +323,7 @@ extern BOOLEAN LYSeekFragAREAinCur; extern BOOLEAN LYStripDotDotURLs; /* Try to fix ../ in some URLs? */ extern BOOLEAN LYForceSSLCookiesSecure; extern BOOLEAN LYNoCc; +extern BOOLEAN LYPreparsedSource; /* Show source as preparsed? */ #ifndef VMS extern BOOLEAN LYNoCore; diff --git a/src/LYLocal.c b/src/LYLocal.c index 6f4b44fa..2865603a 100644 --- a/src/LYLocal.c +++ b/src/LYLocal.c @@ -34,6 +34,7 @@ #include "HTParse.h" #include "LYCurses.h" #include "LYGlobalDefs.h" +#include "HTAlert.h" #include "LYUtils.h" #include "LYStrings.h" #include "LYCharUtils.h" @@ -1353,8 +1354,8 @@ form to permit %s %s.\n</Ol>\n</Form>\n", /* * Call chmod(). */ - sprintf(tmpbuf, "chmod %.4o %s", new_mode, destpath); - sprintf(amode, "%.4o", new_mode); + sprintf(tmpbuf, "chmod %.4o %s", (unsigned int)new_mode, destpath); + sprintf(amode, "%.4o", (unsigned int)new_mode); args[0] = "chmod"; args[1] = amode; args[2] = destpath; @@ -2204,11 +2205,11 @@ PUBLIC int LYExecv ARGS3( int rc; char tmpbuf[512]; pid_t pid; -#if defined(NeXT) || defined(AIX4) || defined(sony_news) +#if HAVE_TYPE_UNION_WAIT && !HAVE_WAITPID union wait wstatus; #else int wstatus; -#endif /* NeXT || AIX4 || sony_news */ +#endif rc = 1; /* It will work */ tmpbuf[0] = '\0'; /* empty buffer for alert messages */ @@ -2223,12 +2224,12 @@ PUBLIC int LYExecv ARGS3( execv(path, argv); exit(-1); /* execv failed, give wait() something to look at */ default: /* parent */ -#if defined(NeXT) || defined(AIX4) || defined(sony_news) +#if HAVE_TYPE_UNION_WAIT && !HAVE_WAITPID while (wait(&wstatus) != pid) ; /* do nothing */ #else waitpid(pid, &wstatus, 0); /* wait for child */ -#endif /* NeXT || AIX4 || sony_news */ +#endif if (WEXITSTATUS(wstatus) != 0 || WTERMSIG(wstatus) > 0) { /* error return */ sprintf(tmpbuf, "Probable failure to %s due to system error!", diff --git a/src/LYMail.c b/src/LYMail.c index dbf3b8a9..028c43bb 100644 --- a/src/LYMail.c +++ b/src/LYMail.c @@ -976,7 +976,12 @@ PUBLIC void reply_by_mail ARGS3( /* * Ask if the user wants to include the original message. */ - _statusline(INC_ORIG_MSG_PROMPT); + BOOLEAN is_preparsed = (LYPreparsedSource && + HTisDocumentSource()); + if (is_preparsed) + _statusline(INC_PREPARSED_MSG_PROMPT); + else + _statusline(INC_ORIG_MSG_PROMPT); c = 0; while (TOUPPER(c) != 'Y' && TOUPPER(c) != 'N' && !term_letter && c != 7 && c != 3) @@ -985,7 +990,10 @@ PUBLIC void reply_by_mail ARGS3( /* * The 1 will add the reply "> " in front of every line. */ - print_wwwfile_to_fd(fd, 1); + if (is_preparsed) + print_wwwfile_to_fd(fd, 0); + else + print_wwwfile_to_fd(fd, 1); } } fclose(fd); /* Close the tmpfile. */ diff --git a/src/LYMain.c b/src/LYMain.c index 10b143c0..39acab19 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -364,6 +364,7 @@ PUBLIC BOOLEAN LYSeekFragAREAinCur = TRUE; PUBLIC BOOLEAN LYStripDotDotURLs = TRUE; /* Try to fix ../ in some URLs? */ PUBLIC BOOLEAN LYForceSSLCookiesSecure = FALSE; PUBLIC BOOLEAN LYNoCc = FALSE; +PUBLIC BOOLEAN LYPreparsedSource = FALSE; /* Show source as preparsed? */ /* These are declared in cutil.h for current freeWAIS libraries. - FM */ #ifdef DECLARE_WAIS_LOGFILES @@ -1356,6 +1357,10 @@ PUBLIC int main ARGS2( } #endif /* USE_SLANG */ + if (LYPreparsedSource) { + HTPreparsedFormatInit(); + } + #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) #ifdef NEVER_ALLOW_REMOTE_EXEC if (local_exec) { @@ -2329,6 +2334,9 @@ PRIVATE void parse_arg ARGS3( StrAllocCat(*post_data, buf); } + } else if (strncmp(argv[0], "-preparsed", 9) == 0) { + LYPreparsedSource = TRUE; + } else if (strncmp(argv[0], "-print", 6) == 0) { no_print=FALSE; @@ -2693,6 +2701,7 @@ Output_Help_List: printf(" popup windows or as lists of radio buttons\n"); printf(" -post_data user data for post forms, read from stdin,\n"); printf(" terminated by '---' on a line\n"); + printf(" -preparsed show parsed text/html with -source and in source view\n"); printf(" -print enable print functions (DEFAULT)\n"); printf(" -pseudo_inlines toggles pseudo-ALTs for inlines with no ALT string\n"); printf(" -raw toggles default setting of 8-bit character translations\n"); diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 4a712098..d2215e02 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -430,19 +430,19 @@ try_again: } } if (try_internal) { - char *cp = strchr(newdoc.address,'#'); - if (cp) { - HTFindPoundSelector(cp+1); + char *hashp = strchr(newdoc.address,'#'); + if (hashp) { + HTFindPoundSelector(hashp+1); } getresult = (HTMainText != NULL) ? NORMAL : NOT_FOUND; try_internal = FALSE; /* done */ /* fix up newdoc.address which may have been fragment-only */ - if (getresult == NORMAL && (!cp || cp == newdoc.address)) { - if (!cp) { + if (getresult == NORMAL && (!hashp || hashp == newdoc.address)) { + if (!hashp) { StrAllocCopy(newdoc.address, HTLoadedDocumentURL()); } else { StrAllocCopy(temp, HTLoadedDocumentURL()); - StrAllocCat(temp, cp); /* append fragment */ + StrAllocCat(temp, hashp); /* append fragment */ StrAllocCopy(newdoc.address, temp); FREE(temp); } @@ -450,15 +450,15 @@ try_again: } else { if (newdoc.internal_link && newdoc.address && *newdoc.address == '#' && nhist > 0) { - char *cp; + char *cp0; if (0==strncmp(history[nhist-1].address, "LYNXIMGMAP:", 11)) - cp = history[nhist-1].address + 11; + cp0 = history[nhist-1].address + 11; else - cp = history[nhist-1].address; - StrAllocCopy(temp, cp); - cp = strchr(temp, '#'); - if (cp) - *cp = '\0'; + cp0 = history[nhist-1].address; + StrAllocCopy(temp, cp0); + cp0 = strchr(temp, '#'); + if (cp0) + *cp0 = '\0'; StrAllocCat(temp, newdoc.address); FREE(newdoc.address); newdoc.address = temp; @@ -1883,6 +1883,14 @@ new_cmd: /* _statusline(WILL_NOT_RELOAD_DOC); sleep(InfoSecs); } else { + /* + * If currently viewing preparsed source, switching + * to the other DTD parsing may show source differences, + * so stay in source view - kw + */ + if (HTisDocumentSource() && LYPreparsedSource) { + HTOutputFormat = WWW_SOURCE; + } HTuncache_current_document(); StrAllocCopy(newdoc.address, curdoc.address); FREE(curdoc.address); diff --git a/src/LYPrint.c b/src/LYPrint.c index 364cc2ca..d6f6e0a1 100644 --- a/src/LYPrint.c +++ b/src/LYPrint.c @@ -81,6 +81,7 @@ PUBLIC int printfile ARGS1( HTAtom *encoding; BOOL use_mime, use_cte, use_type; char *disp_charset; + static BOOLEAN first_mail_preparsed = TRUE; #ifdef VMS extern BOOLEAN HadVMSInterrupt; #else @@ -474,6 +475,32 @@ PUBLIC int printfile ARGS1( break; case MAIL: + if (LYPreparsedSource && first_mail_preparsed && + HTisDocumentSource()) { + _statusline(CONFIRM_MAIL_SOURCE_PREPARSED); + c = 0; + while (TOUPPER(c)!='Y' && TOUPPER(c)!='N' && + c != 7 && c != 3) + c = LYgetch(); +#ifdef VMS + if (HadVMSInterrupt) { + HadVMSInterrupt = FALSE; + _statusline(MAIL_REQUEST_CANCELLED); + sleep(InfoSecs); + break; + } +#endif /* VMS */ + if (c == RTARROW || c == 'y' || c== 'Y' + || c == '\n' || c == '\r') { + addstr(" Ok..."); + first_mail_preparsed = FALSE; + } else { + _statusline(MAIL_REQUEST_CANCELLED); + sleep(InfoSecs); + break; + } + } + _statusline(MAIL_ADDRESS_PROMPT); strcpy(user_response, (personal_mail_address ? personal_mail_address : "")); diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 84c6b718..070fbcfc 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -627,7 +627,7 @@ PUBLIC void read_cfg ARGS1( keypad_mode = LINKS_ARE_NUMBERED; } else if (!strncasecomp(buffer, "DEFAULT_USER_MODE:", 18)) { - if (!strncasecomp(buffer+18, "NOVICE", 5)) + if (!strncasecomp(buffer+18, "NOVICE", 6)) user_mode = NOVICE_MODE; else if (!strncasecomp(buffer+18, "INTER", 5)) user_mode = INTERMEDIATE_MODE; diff --git a/src/LYStrings.c b/src/LYStrings.c index 547dfa82..03bef9af 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -61,13 +61,13 @@ PRIVATE int set_clicked_link ARGS2(int,x,int,y) /* Check the first line of the link */ if ( links[i].hightext != NULL && links[i].ly == y && - (x - links[i].lx) < strlen(links[i].hightext ) ) { + (x - links[i].lx) < (int)strlen(links[i].hightext ) ) { mouse_link=i; } /* Check the second line */ if (links[i].hightext2 != NULL && 1+links[i].ly == y && - (x - links[i].hightext2_offset) < strlen(links[i].hightext2) ) { + (x - links[i].hightext2_offset) < (int)strlen(links[i].hightext2) ) { mouse_link=i; } } diff --git a/src/LYStrings.h b/src/LYStrings.h index e789d0aa..7124a0b9 100644 --- a/src/LYStrings.h +++ b/src/LYStrings.h @@ -15,7 +15,6 @@ extern char * LYstrstr PARAMS((char *chptr, char *tarptr)); extern char * LYno_attr_char_strstr PARAMS((char *chptr, char *tarptr)); extern char * LYno_attr_char_case_strstr PARAMS((char *chptr, char *tarptr)); -#ifdef EXP_CHARTRANS extern char * LYno_attr_mbcs_strstr PARAMS(( char * chptr, char * tarptr, @@ -28,6 +27,7 @@ extern char * LYno_attr_mbcs_case_strstr PARAMS(( BOOL utf_flag, int * nstartp, int * nendp)); +#ifdef EXP_CHARTRANS extern int LYmbcsstrlen PARAMS(( char * str, BOOL utf_flag)); diff --git a/src/LYUtils.c b/src/LYUtils.c index 27898c31..d95a0635 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -5238,8 +5238,10 @@ extern int errno; #if defined(STDC_HEADERS) || defined(USG) #include <string.h> +#ifdef NOTDEFINED #define index strchr #define bcopy(s, d, n) memcpy((d), (s), (n)) +#endif /* NOTDEFINED */ #else /* Not (STDC_HEADERS or USG): */ #include <strings.h> #endif /* STDC_HEADERS or USG */ @@ -5260,7 +5262,7 @@ extern char **environ; PUBLIC int putenv ARGS1( CONST char *, string) { - char *name_end = index (string, '='); + char *name_end = strchr(string, '='); register size_t size; register char **ep; @@ -5291,10 +5293,10 @@ PUBLIC int putenv ARGS1( if (*ep == NULL) { static char **last_environ = NULL; - char **new_environ = (char **) malloc ((size + 2) * sizeof (char *)); + char **new_environ = (char **) malloc ((size + 2) * sizeof (char *)); if (new_environ == NULL) return -1; - (void) bcopy ((char *) environ, (char *) new_environ, size * sizeof (char *)); + (void) memcpy((char *)new_environ, (char *)environ, size * sizeof(char *)); new_environ[size] = (char *) string; new_environ[size + 1] = NULL; if (last_environ != NULL) diff --git a/src/Makefile b/src/Makefile index 30ad4f31..3b325018 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,7 +62,9 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)iso03_uni.h \ $(CHRTR)iso04_uni.h \ $(CHRTR)iso05_uni.h \ + $(CHRTR)iso06_uni.h \ $(CHRTR)iso07_uni.h \ + $(CHRTR)iso08_uni.h \ $(CHRTR)iso09_uni.h \ $(CHRTR)iso10_uni.h \ $(CHRTR)koi8r_uni.h \ @@ -73,6 +75,7 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)cp1250_uni.h \ $(CHRTR)cp1251_uni.h \ $(CHRTR)cp1252_uni.h \ + $(CHRTR)viscii_uni.h \ $(CHRTR)utf8_uni.h \ $(CHRTR)rfc_suni.h \ $(CHRTR)mnemonic_suni.h \ diff --git a/src/UCAux.c b/src/UCAux.c index 3eb5fcfe..401280a5 100644 --- a/src/UCAux.c +++ b/src/UCAux.c @@ -103,6 +103,7 @@ PUBLIC void UCSetTransParams ARGS5( int, cs_out, CONST LYUCcharset*, p_out) { + pT->trans_C0_to_uni = FALSE; pT->transp = (!strcmp(p_in->MIMEname, "x-transparent") || !strcmp(p_out->MIMEname, "x-transparent")); if (pT->transp) { @@ -113,6 +114,9 @@ PUBLIC void UCSetTransParams ARGS5( pT->use_raw_char_in = TRUE; pT->strip_raw_char_in = FALSE; pT->pass_160_173_raw = TRUE; + pT->repl_translated_C0 = (p_out->enc == UCT_ENC_8BIT_C0); + pT->trans_C0_to_uni = (p_in->enc == UCT_ENC_8BIT_C0 || + p_out->enc == UCT_ENC_8BIT_C0); } else { BOOL intm_ucs = FALSE; BOOL use_ucs = FALSE; @@ -126,6 +130,7 @@ PUBLIC void UCSetTransParams ARGS5( pT->do_8bitraw = FALSE; pT->pass_160_173_raw = TRUE; pT->use_raw_char_in = FALSE; /* not used for CJK */ + pT->repl_translated_C0 = FALSE; pT->trans_from_uni = FALSE; /* not used for CJK */ } else { intm_ucs = (cs_in == 0 || pT->decode_utf8 || @@ -133,6 +138,9 @@ PUBLIC void UCSetTransParams ARGS5( (UCT_CP_SUBSETOF_LAT1|UCT_CP_SUBSETOF_UCS2))); pT->trans_to_uni = (!intm_ucs && UCCanUniTranslateFrom(cs_in)); + pT->trans_C0_to_uni = (pT->trans_to_uni && + p_in->enc == UCT_ENC_8BIT_C0); + pT->repl_translated_C0 = (p_out->enc == UCT_ENC_8BIT_C0); pT->strip_raw_char_in = ((!intm_ucs || (p_out->enc == UCT_ENC_7BIT) || (p_out->repertoire & @@ -143,7 +151,8 @@ PUBLIC void UCSetTransParams ARGS5( pT->do_8bitraw = (!use_ucs); pT->pass_160_173_raw = (!use_ucs && !(p_in->like8859 & UCT_R_8859SPECL)); - pT->use_raw_char_in = (!pT->output_utf8 && cs_in == cs_out); + pT->use_raw_char_in = (!pT->output_utf8 && cs_in == cs_out && + !pT->trans_C0_to_uni); pT->trans_from_uni = (use_ucs && !pT->do_8bitraw && !pT->use_raw_char_in && UCCanTranslateUniTo(cs_out)); @@ -163,6 +172,8 @@ PUBLIC void UCTransParams_clear ARGS1( pT->strip_raw_char_in = FALSE; pT->pass_160_173_raw = FALSE; pT->trans_to_uni = FALSE; + pT->trans_C0_to_uni = FALSE; + pT->repl_translated_C0 = FALSE; pT->trans_from_uni = FALSE; } diff --git a/src/UCdomap.c b/src/UCdomap.c index 288b52aa..68b82403 100644 --- a/src/UCdomap.c +++ b/src/UCdomap.c @@ -39,7 +39,9 @@ #include "[.chrtrans]iso03_uni.h" #include "[.chrtrans]iso04_uni.h" #include "[.chrtrans]iso05_uni.h" +#include "[.chrtrans]iso06_uni.h" #include "[.chrtrans]iso07_uni.h" +#include "[.chrtrans]iso08_uni.h" #include "[.chrtrans]iso09_uni.h" #include "[.chrtrans]iso10_uni.h" #include "[.chrtrans]koi8r_uni.h" @@ -51,6 +53,7 @@ #include "[.chrtrans]cp1251_uni.h" #include "[.chrtrans]cp1252_uni.h" #include "[.chrtrans]utf8_uni.h" +#include "[.chrtrans]viscii_uni.h" #include "[.chrtrans]rfc_suni.h" #include "[.chrtrans]mnemonic_suni.h" #ifdef NOTDEFINED @@ -63,7 +66,9 @@ #include "chrtrans/iso03_uni.h" #include "chrtrans/iso04_uni.h" #include "chrtrans/iso05_uni.h" +#include "chrtrans/iso06_uni.h" #include "chrtrans/iso07_uni.h" +#include "chrtrans/iso08_uni.h" #include "chrtrans/iso09_uni.h" #include "chrtrans/iso10_uni.h" #include "chrtrans/koi8r_uni.h" @@ -74,6 +79,7 @@ #include "chrtrans/cp1250_uni.h" #include "chrtrans/cp1251_uni.h" #include "chrtrans/cp1252_uni.h" +#include "chrtrans/viscii_uni.h" #include "chrtrans/utf8_uni.h" #include "chrtrans/rfc_suni.h" #include "chrtrans/mnemonic_suni.h" @@ -1060,11 +1066,15 @@ PUBLIC long int UCTransToUni ARGS2( #ifndef UC_NO_SHORTCUTS if (charset_in == 0) return ch_iu; - if ((unsigned char)ch_in < 128) + if ((unsigned char)ch_in < 128 && (unsigned char)ch_in >= 32) return ch_iu; #endif /* UC_NO_SHORTCUTS */ if (charset_in < 0) return -11; + if ((unsigned char)ch_in < 32 && + LYCharSet_UC[charset_in].enc != UCT_ENC_8BIT_C0) + /* don't translate C0 chars except for specific charsets */ + return ch_iu; if ((UChndl_in = LYCharSet_UC[charset_in].UChndl) < 0) return -11; if (!UCInfo[UChndl_in].num_uni) @@ -1200,7 +1210,8 @@ if (buflen<2) if (rc >= 32) { outbuf[0] = rc; outbuf[1] = '\0'; return 1; - } else { + } else if (rc <= 0) { + outbuf[0] = '\0'; return rc; } } @@ -1261,12 +1272,12 @@ PUBLIC int UCGetLYhndl_byMIME ARGS1( } if (!strncmp(UC_MIMEcharset, "iso-2022-jp", 11)) { return UCGetLYhndl_byMIME("euc-jp"); - } else if (!strcmp(UC_MIMEcharset, "euc-kr")) { - return UCGetLYhndl_byMIME("iso-2022-kr"); + } else if (!strcmp(UC_MIMEcharset, "iso-2022-kr")) { + return UCGetLYhndl_byMIME("euc-kr"); } else if (!strcmp(UC_MIMEcharset, "gb2312")) { - return UCGetLYhndl_byMIME("iso-2022-cn"); - } else if (!strcmp(UC_MIMEcharset, "euc-cn")) { - return UCGetLYhndl_byMIME("iso-2022-cn"); + return UCGetLYhndl_byMIME("euc-cn"); + } else if (!strcmp(UC_MIMEcharset, "iso-2022-cn")) { + return UCGetLYhndl_byMIME("euc-cn"); } else if (!strcmp(UC_MIMEcharset, "windows-1252")) { /* * It's not my fault that Microsoft hasn't registered @@ -1664,7 +1675,9 @@ PUBLIC void UCInit NOARGS UC_CHARSET_SETUP_iso_8859_3; UC_CHARSET_SETUP_iso_8859_4; UC_CHARSET_SETUP_iso_8859_5; + UC_CHARSET_SETUP_iso_8859_6; UC_CHARSET_SETUP_iso_8859_7; + UC_CHARSET_SETUP_iso_8859_8; UC_CHARSET_SETUP_iso_8859_9; UC_CHARSET_SETUP_iso_8859_10; UC_CHARSET_SETUP_koi8_r; @@ -1676,6 +1689,7 @@ PUBLIC void UCInit NOARGS UC_CHARSET_SETUP_windows_1250; UC_CHARSET_SETUP_windows_1251; UC_CHARSET_SETUP_iso_8859_1_windows_; + UC_CHARSET_SETUP_viscii; UC_CHARSET_SETUP_unicode_1_1_utf_8; UC_CHARSET_SETUP_mnemonic_ascii_0; UC_CHARSET_SETUP_mnemonic; diff --git a/src/chrtrans/MAKEW32.BAT b/src/chrtrans/MAKEW32.BAT index 0c17aa1d..4a3afaf9 100644 --- a/src/chrtrans/MAKEW32.BAT +++ b/src/chrtrans/MAKEW32.BAT @@ -19,6 +19,7 @@ makeuctb cp852_uni.tbl > cp852_uni.h makeuctb cp1250_uni.tbl > cp1250_uni.h makeuctb cp1251_uni.tbl > cp1251_uni.h makeuctb cp1252_uni.tbl > cp1252_uni.h +makeuctb viscii_uni.tbl > viscii_uni.h makeuctb utf8_uni.tbl > utf8_uni.h makeuctb mnemonic_suni.tbl > mnemonic_suni.h makeuctb mnem_suni.tbl > mnem_suni.h diff --git a/src/chrtrans/Makefile b/src/chrtrans/Makefile index f5a44374..3b75ab08 100644 --- a/src/chrtrans/Makefile +++ b/src/chrtrans/Makefile @@ -28,7 +28,9 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)iso03_uni.h \ $(CHRTR)iso04_uni.h \ $(CHRTR)iso05_uni.h \ + $(CHRTR)iso06_uni.h \ $(CHRTR)iso07_uni.h \ + $(CHRTR)iso08_uni.h \ $(CHRTR)iso09_uni.h \ $(CHRTR)iso10_uni.h \ $(CHRTR)koi8r_uni.h \ @@ -39,6 +41,7 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)cp1250_uni.h \ $(CHRTR)cp1251_uni.h \ $(CHRTR)cp1252_uni.h \ + $(CHRTR)viscii_uni.h \ $(CHRTR)utf8_uni.h \ $(CHRTR)rfc_suni.h \ $(CHRTR)mnemonic_suni.h \ @@ -60,7 +63,9 @@ def7_uni.h: def7_uni.tbl makeuctb iso03_uni.h: iso03_uni.tbl makeuctb iso04_uni.h: iso04_uni.tbl makeuctb iso05_uni.h: iso05_uni.tbl makeuctb +iso06_uni.h: iso06_uni.tbl makeuctb iso07_uni.h: iso07_uni.tbl makeuctb +iso08_uni.h: iso08_uni.tbl makeuctb iso09_uni.h: iso09_uni.tbl makeuctb iso10_uni.h: iso10_uni.tbl makeuctb koi8r_uni.h: koi8r_uni.tbl makeuctb diff --git a/src/chrtrans/build-chrtrans.com b/src/chrtrans/build-chrtrans.com index f6f0609e..23c9a2ae 100644 --- a/src/chrtrans/build-chrtrans.com +++ b/src/chrtrans/build-chrtrans.com @@ -88,8 +88,12 @@ $ define/user sys$output 'CHRwhere'iso04_uni.h $ makeuctb iso04_uni.tbl $ define/user sys$output 'CHRwhere'iso05_uni.h $ makeuctb iso05_uni.tbl +$ define/user sys$output 'CHRwhere'iso06_uni.h +$ makeuctb iso06_uni.tbl $ define/user sys$output 'CHRwhere'iso07_uni.h $ makeuctb iso07_uni.tbl +$ define/user sys$output 'CHRwhere'iso08_uni.h +$ makeuctb iso08_uni.tbl $ define/user sys$output 'CHRwhere'iso09_uni.h $ makeuctb iso09_uni.tbl $ define/user sys$output 'CHRwhere'iso10_uni.h @@ -110,6 +114,8 @@ $ define/user sys$output 'CHRwhere'cp1251_uni.h $ makeuctb cp1251_uni.tbl $ define/user sys$output 'CHRwhere'cp1252_uni.h $ makeuctb cp1252_uni.tbl +$ define/user sys$output 'CHRwhere'viscii_uni.h +$ makeuctb viscii_uni.tbl $ define/user sys$output 'CHRwhere'utf8_uni.h $ makeuctb utf8_uni.tbl $ define/user sys$output 'CHRwhere'mnemonic_suni.h diff --git a/src/chrtrans/def7_uni.tbl b/src/chrtrans/def7_uni.tbl index 7978e73a..bba7cc12 100644 --- a/src/chrtrans/def7_uni.tbl +++ b/src/chrtrans/def7_uni.tbl @@ -497,7 +497,24 @@ U+0480:C3 U+0481:c3 U+0490:G3 U+0491:g3 -U+05d0:A+ + +# These may may Yiddish slightly more readable, until we have +# something better. + +0x69 U+05b4 # i +0x61 U+05b7 # a +0x6f U+05b8 # o +0x75 U+05bc # u +0x68 U+05bf # h +0x3a U+05c2 # : + +0x76 U+05f0 # v +U+05f1:oy +U+05f2:ey + +# U+05d0:A+ +0x23 U+05d0 # '#' + U+05d1:B+ U+05d2:G+ U+05d3:D+ @@ -524,6 +541,7 @@ U+05e7:Q+ U+05e8:R+ U+05e9:Sh U+05ea:T+ + U+060c:,+ U+061b:;+ U+061f:?+ @@ -920,7 +938,8 @@ U+1357:pWa U+1358:mYa U+1359:rYa U+135A:fYa -# ETHIOPIC SPACE U+1360 mapped to ASCII space above +# ETHIOPIC SPACE U+1360 mapped to ASCII space +0x20 U+1360 0x3a U+1361 #:: U+1362::: 0x2c U+1363 #:, @@ -1372,7 +1391,7 @@ U+2214:.+ U+2217:* U+2218:Ob U+2219:sb -U+221a:RT +U+221a: SQRT U+221d:0( U+221e:00 U+221f:-L diff --git a/src/chrtrans/iso06_uni.tbl b/src/chrtrans/iso06_uni.tbl index 61630521..46eb3709 100644 --- a/src/chrtrans/iso06_uni.tbl +++ b/src/chrtrans/iso06_uni.tbl @@ -2,45 +2,51 @@ # Unicode mapping table for ISO 8859-6 fonts iso06.* # [use: unicode_start iso06.f16 iso06] # +#The MIME name of this charset. +Miso-8859-6 + +#Name as a Display Charset (used on Options screen). +OISO 8859-6 Arabic + 0x20-0x7e idem -0x7f U+2302 +#0x7f U+2302 # -0x00 U+fffd -0x01 U+263A -0x02 U+263B -0x03 U+2665 -0x04 U+2666 -0x05 U+2663 -0x06 U+2660 -0x07 U+2022 -0x08 U+25D8 -0x09 U+25CB -0x0A U+25D9 -0x0B U+2642 -0x0C U+2640 -0x0D U+266A -0x0E U+266B -0x0E U+266C -0x0F U+263C -0x10 U+25B6 -0x10 U+25BA -0x11 U+25C0 -0x11 U+25C4 -0x12 U+2195 -0x13 U+203C -0x14 U+00B6 -0x15 U+00A7 -0x16 U+25AC -0x17 U+21A8 -0x18 U+2191 -0x19 U+2193 -0x1A U+2192 -0x1B U+2190 -0x1C U+221F -0x1C U+2319 -0x1D U+2194 -0x1E U+25B2 -0x1F U+25BC +#0x00 U+fffd +#0x01 U+263A +#0x02 U+263B +#0x03 U+2665 +#0x04 U+2666 +#0x05 U+2663 +#0x06 U+2660 +#0x07 U+2022 +#0x08 U+25D8 +#0x09 U+25CB +#0x0A U+25D9 +#0x0B U+2642 +#0x0C U+2640 +#0x0D U+266A +#0x0E U+266B +#0x0E U+266C +#0x0F U+263C +#0x10 U+25B6 +#0x10 U+25BA +#0x11 U+25C0 +#0x11 U+25C4 +#0x12 U+2195 +#0x13 U+203C +#0x14 U+00B6 +#0x15 U+00A7 +#0x16 U+25AC +#0x17 U+21A8 +#0x18 U+2191 +#0x19 U+2193 +#0x1A U+2192 +#0x1B U+2190 +#0x1C U+221F +#0x1C U+2319 +#0x1D U+2194 +#0x1E U+25B2 +#0x1F U+25BC # 0xa0 U+00a0 0xa4 U+00a4 @@ -96,3 +102,11 @@ # TRADE MARK SIGN: U+2122:(TM) + +0x60 U+2018 # left single quotation mark <`> +0x27 U+2019-U+201b # various single quotation marks <'> +0x22 U+201c-U+201f # various double quotation marks <"> + +# Let's try to show a question mark for character that cannot +# be shown. U+fffd is used for invalid characters. +U+fffd:? diff --git a/src/chrtrans/iso08_uni.tbl b/src/chrtrans/iso08_uni.tbl index 20ae4ac7..f11dff4a 100644 --- a/src/chrtrans/iso08_uni.tbl +++ b/src/chrtrans/iso08_uni.tbl @@ -2,45 +2,51 @@ # Unicode mapping table for ISO 8859-8 fonts iso08.* # [use: unicode_start iso08.f16 iso08] # +#The MIME name of this charset. +Miso-8859-8 + +#Name as a Display Charset (used on Options screen). +OISO 8859-8 Hebrew + 0x20-0x7e idem -0x7f U+2302 +#0x7f U+2302 # -0x00 U+fffd -0x01 U+263A -0x02 U+263B -0x03 U+2665 -0x04 U+2666 -0x05 U+2663 -0x06 U+2660 -0x07 U+2022 -0x08 U+25D8 -0x09 U+25CB -0x0A U+25D9 -0x0B U+2642 -0x0C U+2640 -0x0D U+266A -0x0E U+266B -0x0E U+266C -0x0F U+263C -0x10 U+25B6 -0x10 U+25BA -0x11 U+25C0 -0x11 U+25C4 -0x12 U+2195 -0x13 U+203C -0x14 U+00B6 -0x15 U+00A7 -0x16 U+25AC -0x17 U+21A8 -0x18 U+2191 -0x19 U+2193 -0x1A U+2192 -0x1B U+2190 -0x1C U+221F -0x1C U+2319 -0x1D U+2194 -0x1E U+25B2 -0x1F U+25BC +#0x00 U+fffd +#0x01 U+263A +#0x02 U+263B +#0x03 U+2665 +#0x04 U+2666 +#0x05 U+2663 +#0x06 U+2660 +#0x07 U+2022 +#0x08 U+25D8 +#0x09 U+25CB +#0x0A U+25D9 +#0x0B U+2642 +#0x0C U+2640 +#0x0D U+266A +#0x0E U+266B +#0x0E U+266C +#0x0F U+263C +#0x10 U+25B6 +#0x10 U+25BA +#0x11 U+25C0 +#0x11 U+25C4 +#0x12 U+2195 +#0x13 U+203C +#0x14 U+00B6 +#0x15 U+00A7 +#0x16 U+25AC +#0x17 U+21A8 +#0x18 U+2191 +#0x19 U+2193 +#0x1A U+2192 +#0x1B U+2190 +#0x1C U+221F +#0x1C U+2319 +#0x1D U+2194 +#0x1E U+25B2 +#0x1F U+25BC # 0xa0 U+00a0 0xa2-0xa9 idem @@ -80,5 +86,24 @@ 0xf9 U+05e9 0xfa U+05ea +#Hebrew points - map to empty string +U+05B0-U+05C2: + +#HEBREW LETTER DOUBLE VAV +U+05F0:åå +#HEBREW LETTER VAV YOD +U+05F1:éå +#HEBREW LETTER DOUBLE YOD +U+05F2:éé + + # TRADE MARK SIGN: U+2122:(TM) + +0x60 U+2018 # left single quotation mark <`> +0x27 U+2019-U+201b # various single quotation marks <'> +0x22 U+201c-U+201f # various double quotation marks <"> + +# Let's try to show a question mark for character that cannot +# be shown. U+fffd is used for invalid characters. +U+fffd:? diff --git a/src/chrtrans/makefile.in b/src/chrtrans/makefile.in index 924b6a77..a15d5da7 100644 --- a/src/chrtrans/makefile.in +++ b/src/chrtrans/makefile.in @@ -41,7 +41,9 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)iso03_uni.h \ $(CHRTR)iso04_uni.h \ $(CHRTR)iso05_uni.h \ + $(CHRTR)iso06_uni.h \ $(CHRTR)iso07_uni.h \ + $(CHRTR)iso08_uni.h \ $(CHRTR)iso09_uni.h \ $(CHRTR)iso10_uni.h \ $(CHRTR)koi8r_uni.h \ @@ -52,6 +54,7 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)cp1250_uni.h \ $(CHRTR)cp1251_uni.h \ $(CHRTR)cp1252_uni.h \ + $(CHRTR)viscii_uni.h \ $(CHRTR)utf8_uni.h \ $(CHRTR)rfc_suni.h \ $(CHRTR)mnemonic_suni.h \ @@ -77,22 +80,28 @@ makeuctb: makeuctb.c UCkd.h .tbl.h: ./makeuctb $*.tbl > $@ +# table files listed here once again to get the make dependencies +# right, in case makeuctb was recompiled. iso01_uni.h: iso01_uni.tbl makeuctb iso02_uni.h: iso02_uni.tbl makeuctb def7_uni.h: def7_uni.tbl makeuctb iso03_uni.h: iso03_uni.tbl makeuctb iso04_uni.h: iso04_uni.tbl makeuctb iso05_uni.h: iso05_uni.tbl makeuctb +iso06_uni.h: iso06_uni.tbl makeuctb iso07_uni.h: iso07_uni.tbl makeuctb +iso08_uni.h: iso08_uni.tbl makeuctb iso09_uni.h: iso09_uni.tbl makeuctb iso10_uni.h: iso10_uni.tbl makeuctb koi8r_uni.h: koi8r_uni.tbl makeuctb cp437_uni.h: cp437_uni.tbl makeuctb cp850_uni.h: cp850_uni.tbl makeuctb cp852_uni.h: cp852_uni.tbl makeuctb +cp852_uni.h: cp866_uni.tbl makeuctb cp1250_uni.h: cp1250_uni.tbl makeuctb cp1251_uni.h: cp1251_uni.tbl makeuctb cp1252_uni.h: cp1252_uni.tbl makeuctb +viscii_uni.h: viscii_uni.tbl makeuctb utf8_uni.h: utf8_uni.tbl makeuctb mnemonic_suni.h: mnemonic_suni.tbl makeuctb mnem_suni.h: mnem_suni.tbl makeuctb diff --git a/src/chrtrans/makeuctb.c b/src/chrtrans/makeuctb.c index 95ba076d..f981f777 100644 --- a/src/chrtrans/makeuctb.c +++ b/src/chrtrans/makeuctb.c @@ -488,7 +488,7 @@ PUBLIC int main ARGS2( if (argc >= 3) { strncpy(this_MIMEcharset,argv[2],UC_MAXLEN_MIMECSNAME); - } else if (!this_MIMEcharset || !(*this_MIMEcharset)) { + } else if (this_MIMEcharset[0] == '\0') { strncpy(this_MIMEcharset,tblname,UC_MAXLEN_MIMECSNAME); if ((p = strchr(this_MIMEcharset,'.')) != 0) { *p = '\0'; @@ -499,7 +499,7 @@ PUBLIC int main ARGS2( } if (argc >= 4) { strncpy(this_LYNXcharset,argv[3],UC_MAXLEN_LYNXCSNAME); - } else if (!this_LYNXcharset || !(*this_LYNXcharset)) { + } else if (this_LYNXcharset[0] == '\0') { strncpy(this_LYNXcharset,this_MIMEcharset,UC_MAXLEN_LYNXCSNAME); } if ((i = strlen(this_LYNXcharset)) < UC_LEN_LYNXCSNAME) { diff --git a/src/chrtrans/utf8_uni.tbl b/src/chrtrans/utf8_uni.tbl index 02e153a5..4cc4df97 100644 --- a/src/chrtrans/utf8_uni.tbl +++ b/src/chrtrans/utf8_uni.tbl @@ -21,8 +21,8 @@ O UNICODE UTF 8 # but for completeness (from UCDefs.h): # #define UCT_ENC_7BIT 0 # #define UCT_ENC_8BIT 1 -# #define UCT_ENC_8859 2 /* ??? */ -# #define UCT_ENC_2022 3 +# #define UCT_ENC_8859 2 +# #define UCT_ENC_8BIT_C0 3 # #define UCT_ENC_MAYBE2022 4 # #define UCT_ENC_CJK 5 # #define UCT_ENC_16BIT 6 diff --git a/src/chrtrans/viscii_uni.tbl b/src/chrtrans/viscii_uni.tbl new file mode 100644 index 00000000..006fa0ea --- /dev/null +++ b/src/chrtrans/viscii_uni.tbl @@ -0,0 +1,306 @@ +# +# Unicode mapping table for VISCII 1.1 fonts and charset=viscii, +# described in RFC 1456. +# See also <URL:http://www.trichlor.org/vietstd/report/rep92.htm>, +# also for testing. +# The 6 characters encoded in the C0 control region should not +# be passed through to the terminal but be mapped to VIQR strings. +# THe two changed mappings of MacVISCII are recognized in documents. + +# [convert with makeuctb] +# +#The MIME name of this charset. +Mviscii + +#Name as a Display Charset (used on Options screen). +OVietnamese (VISCII) + +# Special 'enc' flag to signal that some C0 characters are used. +# Tables with R3 should properly map the allowed C0 control chars! +# +# most of these codes currently don't make much sense in a *.uni file, +# but for completeness (from UCDefs.h): +# #define UCT_ENC_7BIT 0 +# #define UCT_ENC_8BIT 1 +# #define UCT_ENC_8859 2 +# #define UCT_ENC_8BIT_C0 3 +# #define UCT_ENC_MAYBE2022 4 +# #define UCT_ENC_CJK 5 +# #define UCT_ENC_16BIT 6 +# #define UCT_ENC_UTF8 7 + +R 3 + +#0x00 U+0000 +#0x01 U+0001 +#0x03 U+0003 +#0x04 U+0004 +#0x07 U+0007 +#0x08 U+0008 +0x09 U+0009 +0x0a U+000a +#0x0b U+000b +0x0c U+000c +U+000c: +0x0d U+000d +#0x0e U+000e +#0x0f U+000f +#0x10 U+0010 +#0x11 U+0011 +#0x12 U+0012 +#0x13 U+0013 +#0x15 U+0015 +#0x16 U+0016 +#0x17 U+0017 +#0x18 U+0018 +0x1a U+001a +U+001a:^Z +#0x1b U+001b +#0x1c U+001c +#0x1d U+001d +#0x1f U+001f +#0x20 U+0020 +#0x21 U+0021 +#0x22 U+0022 +#0x23 U+0023 +#0x24 U+0024 +#0x25 U+0025 +#0x26 U+0026 +#0x27 U+0027 +#0x28 U+0028 +#0x29 U+0029 +#0x2a U+002a +#0x2b U+002b +#0x2c U+002c +#0x2d U+002d +#0x2e U+002e +#0x2f U+002f +#0x30 U+0030 +#0x31 U+0031 +#0x32 U+0032 +#0x33 U+0033 +#0x34 U+0034 +#0x35 U+0035 +#0x36 U+0036 +#0x37 U+0037 +#0x38 U+0038 +#0x39 U+0039 +#0x3a U+003a +#0x3b U+003b +#0x3c U+003c +#0x3d U+003d +#0x3e U+003e +#0x3f U+003f +#0x40 U+0040 +#0x41 U+0041 +#0x42 U+0042 +#0x43 U+0043 +#0x44 U+0044 +#0x45 U+0045 +#0x46 U+0046 +#0x47 U+0047 +#0x48 U+0048 +#0x49 U+0049 +#0x4a U+004a +#0x4b U+004b +#0x4c U+004c +#0x4d U+004d +#0x4e U+004e +#0x4f U+004f +#0x50 U+0050 +#0x51 U+0051 +#0x52 U+0052 +#0x53 U+0053 +#0x54 U+0054 +#0x55 U+0055 +#0x56 U+0056 +#0x57 U+0057 +#0x58 U+0058 +#0x59 U+0059 +#0x5a U+005a +#0x5b U+005b +#0x5c U+005c +#0x5d U+005d +#0x5e U+005e +#0x5f U+005f +#0x60 U+0060 +#0x61 U+0061 +#0x62 U+0062 +#0x63 U+0063 +#0x64 U+0064 +#0x65 U+0065 +#0x66 U+0066 +#0x67 U+0067 +#0x68 U+0068 +#0x69 U+0069 +#0x6a U+006a +#0x6b U+006b +#0x6c U+006c +#0x6d U+006d +#0x6e U+006e +#0x6f U+006f +#0x70 U+0070 +#0x71 U+0071 +#0x72 U+0072 +#0x73 U+0073 +#0x74 U+0074 +#0x75 U+0075 +#0x76 U+0076 +#0x77 U+0077 +#0x78 U+0078 +#0x79 U+0079 +#0x7a U+007a +#0x7b U+007b +#0x7c U+007c +#0x7d U+007d +#0x7e U+007e +#0x7f U+007f +0xc0 U+00c0 +0xc1 U+00c1 +0xc2 U+00c2 +0xc3 U+00c3 +0xc8 U+00c8 +0xc9 U+00c9 +0xca U+00ca +0xcc U+00cc +0xcd U+00cd +0xd2 U+00d2 +0xd3 U+00d3 +0xd4 U+00d4 +0xa0 U+00d5 +0xd9 U+00d9 +0xda U+00da +0xdd U+00dd +0xe0 U+00e0 +0xe1 U+00e1 +0xe2 U+00e2 +0xe3 U+00e3 +0xe8 U+00e8 +0xe9 U+00e9 +0xea U+00ea +0xec U+00ec +0xed U+00ed +0xf2 U+00f2 +0xf3 U+00f3 +0xf4 U+00f4 +0xf5 U+00f5 +0xf9 U+00f9 +0xfa U+00fa +0xfd U+00fd +0xc5 U+0102 +0xe5 U+0103 +0xd0 U+0110 +0xf0 U+0111 U+00f0 # "edh" is similar enough to map it here +0xce U+0128 +0xee U+0129 +0x9d U+0168 +0xfb U+0169 +0xb4 U+01a0 +0xbd U+01a1 +0xbf U+01af +0xdf U+01b0 +0x80 U+1ea0 +0xd5 U+1ea1 +0xc4 U+1ea2 +0xe4 U+1ea3 +0x84 U+1ea4 +0xa4 U+1ea5 +0x85 U+1ea6 +0xa5 U+1ea7 +0x86 U+1ea8 +0xa6 U+1ea9 +0x06 U+1eaa +U+1eaa:Â~ +0xe7 U+1eab +0x87 U+1eac +0xa7 U+1ead +0x81 U+1eae +0xa1 U+1eaf +0x82 U+1eb0 +0xa2 U+1eb1 +0x02 U+1eb2 +U+1eb2:A(? +0xc6 U+1eb3 +0x05 U+1eb4 +U+1eb4:A(~ +0xc7 U+1eb5 +0x83 U+1eb6 +0xa3 U+1eb7 +0x89 U+1eb8 +0xa9 U+1eb9 +0xcb U+1eba +0xeb U+1ebb +0x88 U+1ebc +0xa8 U+1ebd +0x8a U+1ebe +0xaa U+1ebf +0x8b U+1ec0 +0xab U+1ec1 +0x8c U+1ec2 +0xac U+1ec3 +0x8d U+1ec4 +0xad U+1ec5 +0x8e U+1ec6 +0xae U+1ec7 +0x9b U+1ec8 +0xef U+1ec9 +0x98 U+1eca +0xb8 U+1ecb +0x9a U+1ecc +0xf7 U+1ecd +0x99 U+1ece +0xf6 U+1ecf +0x8f U+1ed0 +0xaf U+1ed1 +0x90 U+1ed2 +0xb0 U+1ed3 +0x91 U+1ed4 +0xb1 U+1ed5 +0x92 U+1ed6 +0xb2 U+1ed7 +0x93 U+1ed8 +0xb5 U+1ed9 +0x95 U+1eda +0xbe U+1edb +0x96 U+1edc +0xb6 U+1edd +0x97 U+1ede +0xb7 U+1edf +0xb3 U+1ee0 +0xde U+1ee1 +0x94 U+1ee2 +0xfe U+1ee3 +0x9e U+1ee4 +0xf8 U+1ee5 +0x9c U+1ee6 +0xfc U+1ee7 +0xba U+1ee8 +0xd1 U+1ee9 +0xbb U+1eea +0xd7 U+1eeb +0xbc U+1eec +0xd8 U+1eed +0xff U+1eee +0xe6 U+1eef +0xb9 U+1ef0 +0xf1 U+1ef1 +0x9f U+1ef2 +0xcf U+1ef3 +0x18 U+1ef4 # MacVISCII +0x1e U+1ef4 +U+1ef4:Y. +0xdc U+1ef5 +0x17 U+1ef6 # MacVISCII +0x14 U+1ef6 +U+1ef6:Y? +0xd6 U+1ef7 +0x19 U+1ef8 +U+1ef8:Y~ +0xdb U+1ef9 + +# TRADE MARK SIGN: +U+2122:(TM) + +0x60 U+2018 # left single quotation mark <`> +0x27 U+2019-U+201b # various single quotation marks <'> +0x22 U+201c-U+201f # various double quotation marks <"> diff --git a/src/makefile.in b/src/makefile.in index 897dc39e..d42883b9 100644 --- a/src/makefile.in +++ b/src/makefile.in @@ -102,7 +102,9 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)iso03_uni.h \ $(CHRTR)iso04_uni.h \ $(CHRTR)iso05_uni.h \ + $(CHRTR)iso06_uni.h \ $(CHRTR)iso07_uni.h \ + $(CHRTR)iso08_uni.h \ $(CHRTR)iso09_uni.h \ $(CHRTR)iso10_uni.h \ $(CHRTR)koi8r_uni.h \ @@ -113,6 +115,7 @@ TABLES= $(CHRTR)iso02_uni.h \ $(CHRTR)cp1250_uni.h \ $(CHRTR)cp1251_uni.h \ $(CHRTR)cp1252_uni.h \ + $(CHRTR)viscii_uni.h \ $(CHRTR)utf8_uni.h \ $(CHRTR)rfc_suni.h \ $(CHRTR)mnemonic_suni.h \ |