/*============================================================================= GNU UnRTF, a command-line program to convert RTF documents to other formats. Copyright (C) 2000,2001,2004 by Zachary Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au =============================================================================*/ /*---------------------------------------------------------------------- * Module name: html * Author name: Zachary Smith * Create date: 18 Sep 01 * Purpose: HTML-specific output module *---------------------------------------------------------------------- * Changes: * 01 Aug 01, tuorfa@yahoo.com: code moved over from convert.c * 03 Aug 01, tuorfa@yahoo.com: removed null entries to save space * 08 Aug 01, tuorfa@yahoo.com, gommer@gmx.net: fixed/added some ANSI chars * 18 Sep 01, tuorfa@yahoo.com: moved character sets into html.c etc * 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks * 08 Oct 03, daved@physiol.usyd.edu.au: mac special character fixes * 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith * 29 Mar 05, daved@physiol.usyd.edu.au: more unicode characters * 21 Jul 05, daved@physiol.usyd.edu.au: added endash * 19 Aug 05, ax2groin@arbornet.org: added more chars and changes to ANSI * 05 Jan 06, marcossamaral@terra.com.br: fixed bugs #14982 and #14983 * 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions * 13 Dec 07, daved@physiol.usyd.edu.au: fixed some missing entity ';' * 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3 *--------------------------------------------------------------------*/ #ifdef LMMS_HAVE_CONFIG_H #include #endif #ifdef LMMS_HAVE_STDIO_H #include #endif #ifdef LMMS_HAVE_STRING_H #include #endif #include "malloc.h" #include "defs.h" #include "error.h" #include "main.h" #include "output.h" static const char* ascii [96] = { /* 0x20 */ " ", "!", """, "#", "$", "%", "&", "'", /* 0x28 */ "(", ")", "*", "+", ",", "-", ".", "/", /* 0x30 */ "0", "1", "2", "3", "4", "5", "6", "7", /* 0x38 */ "8", "9", ":", ";", "<", "=", ">", "?", /* 0x40 */ "@", "A", "B", "C", "D", "E", "F", "G", /* 0x48 */ "H", "I", "J", "K", "L", "M", "N", "O", /* 0x50 */ "P", "Q", "R", "S", "T", "U", "V", "W", /* 0x58 */ "X", "Y", "Z", "[", "\\", "]", "^", "_", /* 0x60 */ "`", "a", "b", "c", "d", "e", "f", "g", /* 0x68 */ "h", "i", "j", "k", "l", "m", "n", "o", /* 0x70 */ "p", "q", "r", "s", "t", "u", "v", "w", /* 0x78 */ "x", "y", "z", "{", "|", "}", "~", "" }; static const char* ansi [] = { /* 0x78 */ "x", /* 0x79 */ "y", /* 0x7a */ "z", /* 0x7b */ "{", /* 0x7c */ "|", /* 0x7d */ "}", /* 0x7e */ "~", /* 0x7f */ "", /* 0x80 */ "€", /* € may be more widely recognized. */ /* 0x81 */ "", /* 0x82 */ "‚", /* ‚ not implemented in any browsers I've seen. */ /* 0x83 */ "ƒ", /* 0x84 */ "„", /* „ not implemented in any browsers I've seen. */ /* 0x85 */ "…", /* 0x86 */ "†", /* 0x87 */ "‡", /* 0x88 */ "ˆ", /* 0x89 */ "‰", /* 0x8a */ "Š", /* 0x8b */ "‹", /* 0x8c */ "Œ", /* 0x8d */ "", /* 0x8e */ "Ž", /* 0x8f */ "", /* 0x90 */ "", "‘", "’", "“", "”", "•", "–", "—", /* 0x98 */ "˜", /* 0x99 */ "™", /* 0x9a */ "š", /* 0x9b */ "›", /* daved - 0.9.6 */ /* 0x9c */ "œ", /* 0x9d */ "", /* 0x9e */ "ž", /* 0x9f */ "Ÿ", /* 0xa0 */ " ","¡","¢","£","¤","¥","¦","§", /* 0xa8 */ "¨","©","ª","«","¬","­","®","¯", /* 0xb0 */ "°", "±","²","³","´","µ","¶","·", /* 0xb8 */ "¸","¹", "º","»", "¼", "½","¾","¿", /* 0xc0 */ "À","Á","Â","Ã","Ä","Å","Æ","Ç", /* 0xc8 */ "È","É","Ê","Ë","Ì","Í","Î","Ï", /* 0xd0 */ "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×", /* 0xd8 */ "Ø","Ù","Ú","Û","Ü","Ý","Þ","ß", /* 0xe0 */ "à","á","â","ã","ä","å","æ","ç", /* 0xe8 */ "è","é","ê","ë","ì","í","î","ï", /* 0xf0 */ "ð","ñ","ò","ó","ô","õ","ö","÷", /* 0xf8 */ "ø","ù","ú","û","ü","ý","þ","ÿ" }; static const char* mac [] = { /* 0xa4 */ "•", NULL,NULL,NULL, /* 0xa8 */ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, /* 0xb0 */ NULL,NULL,NULL,NULL,NULL,"μ",NULL,NULL, /* 0xb8 */ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, /* 0xc0 */ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, /* 0xc8 */ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, /* 0xd0 */ "—","–","“","”","&lquo;","&rquo;" }; #if 1 /* daved - 0.19.4 - unicode symbol character support */ static const char * unisymbol1[] = { /* 913 */ "Α", /* 914 */ "Β", /* 915 */ "Γ", /* 916 */ "Δ", /* 917 */ "Ε", /* 918 */ "Ζ", /* 919 */ "Η", /* 920 */ "Θ", /* 921 */ "Ι", /* 922 */ "Κ", /* 923 */ "Λ", /* 924 */ "Μ", /* 925 */ "Ν", /* 926 */ "Ξ", /* 927 */ "Ο", /* 928 */ "Π", /* 929 */ "Ρ", /* 930 */ 0, /* 931 */ "Σ", /* 932 */ "Τ", /* 933 */ "Υ", /* 934 */ "Φ", /* 935 */ "Χ", /* 936 */ "Ψ", /* 937 */ "Ω", /* 938 */ 0, /* 939 */ 0, /* 940 */ 0, /* 941 */ 0, /* 942 */ 0, /* 943 */ 0, /* 944 */ 0, /* 945 */ "α", /* 946 */ "β", /* 947 */ "γ", /* 948 */ "δ", /* 949 */ "ε", /* 950 */ "ζ", /* 951 */ "η", /* 952 */ "θ", /* 953 */ "ι", /* 954 */ "κ", /* 955 */ "λ", /* 956 */ "μ", /* 957 */ "ν", /* 958 */ "ξ", /* 959 */ "ο", /* 960 */ "π", /* 961 */ "ρ", /* 962 */ "ς", /* 963 */ "σ", /* 964 */ "τ", /* 965 */ "υ", /* 966 */ "φ", /* 967 */ "χ", /* 968 */ "ψ", /* 969 */ "ω", /* 970 */ 0, /* 971 */ 0, /* 972 */ 0, /* 973 */ 0, /* 974 */ 0, /* 975 */ 0, /* 976 */ 0, /* 977 */ "ϑ", /* 978 */ "ϒ", /* 979 */ 0, /* 980 */ 0, /* 981 */ 0, /* 982 */ "ϖ", }; #endif #if 1 /* daved - 0.19.4 - unicode symbol character support */ static const char * unisymbol2[] = { /* 57516 */ "Γ", /* 57517 */ "Δ", /* 57518 */ "Θ", /* 57519 */ "Λ", /* 57520 */ "Ξ", /* 57521 */ "Π", /* 57522 */ "Σ", /* 57523 */ "Υ", /* 57524 */ "Φ", /* 57525 */ "Ψ", /* 57526 */ "Ω", /* 57527 */ "α", /* 57528 */ "β", /* 57529 */ "γ", /* 57530 */ "δ", /* 57531 */ "ε", /* 57532 */ "ζ", /* 57533 */ "η", /* 57534 */ "θ", /* 57535 */ "ι", /* 57536 */ "κ", /* 57537 */ "λ", /* 57538 */ "μ", /* 57539 */ "ν", /* 57540 */ "ξ", /* 57541 */ "ο", /* 57542 */ "π", /* 57543 */ "ρ", /* 57544 */ "σ", /* 57545 */ "τ", /* 57546 */ "υ", /* 57547 */ "φ", /* 57548 */ "χ", /* 57549 */ "ψ", /* 57550 */ "ω", /* 57551 */ "ϵ", /* 57552 */ "ϑ", /* 57553 */ "ϖ", /* 57554 */ 0, /* 57555 */ "ς", /* 57556 */ "ϕ", /* 57557 */ "δ", }; static const char * unisymbol3[] = { /* 61505 */ "Α", /* 61506 */ "Β", /* 61507 */ "Χ", /* 61508 */ "Δ", /* 61509 */ "Ε", /* 61510 */ "Φ", /* 61511 */ "Γ", /* 61512 */ "Η", /* 61513 */ "Ι", /* 61514 */ "ϕ", /* 61515 */ "Κ", /* 61516 */ "Λ", /* 61517 */ "Μ", /* 61518 */ "Ν", /* 61519 */ "Ο", /* 61520 */ "Π", /* 61521 */ "Θ", /* 61522 */ "Ρ", /* 61523 */ "Σ", /* 61524 */ "Τ", /* 61525 */ "Υ", /* 61526 */ "ς", /* 61527 */ "Ω", /* 61528 */ "Ξ", /* 61529 */ "Ψ", /* 61530 */ "Ζ", /* 61531 */ 0, /* 61532 */ 0, /* 61533 */ 0, /* 61534 */ 0, /* 61535 */ 0, /* 61536 */ 0, /* 61537 */ "α", /* 61538 */ "β", /* 61539 */ "χ", /* 61540 */ "δ", /* 61541 */ "ε", /* 61542 */ "φ", /* 61543 */ "γ", /* 61544 */ "η", /* 61545 */ "τ", /* 61546 */ "ϕ", /* 61547 */ "κ", /* 61548 */ "λ", /* 61549 */ "μ", /* 61550 */ "ν", /* 61551 */ "ο", /* 61552 */ "π", /* 61553 */ "θ", /* 61554 */ "ρ", /* 61555 */ "σ", /* 61556 */ "τ", /* 61557 */ "υ", /* 61558 */ "ϖ", /* 61559 */ "ω", /* 61560 */ "ξ", /* 61561 */ "ψ", /* 61562 */ "ζ", }; #endif #if 1 /* 0.19.5 more unicode characters */ static const char * unisymbol4[] = { /* 61600 */ "€", /* 61601 */ "ϒ", /* 61602 */ "′", /* 61603 */ "≤", /* 61604 */ "⁄", /* 61605 */ "∞", /* 61606 */ "ƒ", /* 61607 */ "♣", /* 61608 */ "♦", /* 61609 */ "♥", /* 61610 */ "♠", /* 61611 */ "↔", /* 61612 */ "&larr", /* 61613 */ "↑", /* 61614 */ "→", /* 61615 */ "↓", /* 61616 */ "°", /* 61617 */ "±", /* 61618 */ "″", /* 61619 */ "≥", /* 61620 */ "×", /* 61621 */ "∝", /* 61622 */ "∂", /* 61623 */ "•", /* 61624 */ "÷", /* 61625 */ "≠", /* 61626 */ "≡", /* 61627 */ "≈", /* 61628 */ "…", /* 61629 */ 0, /* vertical bar */ /* 61630 */ "—", /* 61631 */ "↵", /* 61632 */ "ℵ", /* 61633 */ "ℑ", /* 61634 */ "ℜ", /* 61635 */ "℘", /* 61636 */ "⊗", /* 61637 */ "⊕", /* 61638 */ "∅", /* 61639 */ "∩", /* 61640 */ "∪", /* 61641 */ "⊃", /* 61642 */ "⊇", /* 61643 */ "⊄", /* 61644 */ "⊂", /* 61645 */ "⊆", /* 61646 */ "∈", /* 61647 */ "∉", /* 61648 */ "∠", /* 61649 */ "∇", /* 61650 */ "®", /* 61651 */ "©", /* 61652 */ "™", /* 61653 */ "∏", /* 61654 */ "√", /* 61655 */ "·", /* 61656 */ "¬", /* 61657 */ "∧", /* 61658 */ "∨", /* 61659 */ "⇔", /* 61660 */ "⇐", /* 61661 */ "⇑", /* 61662 */ "⇒", /* 61663 */ "⇓", /* 61664 */ "◊", /* 61665 */ "⟨", /* 61666 */ "®", /* 61667 */ "©", /* 61668 */ "™", /* 61669 */ "∑", /* 61670 */ 0, /* large right parenthesis ceiling */ /* 61671 */ 0, /* large parenthesis middle */ /* 61672 */ 0, /* large left parenthesis floor */ /* 61673 */ "⌈", /* large left square bracket ceiling */ /* 61674 */ 0, /* large left square bracket middle */ /* 61675 */ "⌊", /* large left square bracket floor */ /* 61676 */ 0, /* large left bracket ceiling */ /* 61677 */ 0, /* large left bracket middle */ /* 61678 */ 0, /* large left bracket floor */ /* 61679 */ 0, /* large vertical bar */ /* 61680 */ 0, /* appears blank */ /* 61681 */ "⟩", /* 61682 */ "∫", /* integral */ /* 61683 */ 0, /* large integral ceiling */ /* 61684 */ 0, /* large integral middle */ /* 61685 */ 0, /* large integral floor */ /* 61686 */ 0, /* large right parenthesis ceiling */ /* 61687 */ 0, /* large right parenthesis middle */ /* 61688 */ 0, /* large right parenthesis floor */ /* 61689 */ "⌉", /* large right square bracket ceiling */ /* 61690 */ 0, /* large right square bracket middle */ /* 61691 */ "⌋", /* large right square bracket floor */ /* 61692 */ 0, /* large right bracket middle */ /* 61694 */ 0 /* large right bracket floot */ }; #endif #if 1 /* daved - SYMBOL font characters */ static const char* symbol[] = { /* 60 */ "<", /* 61 */ "=", /* 62 */ ">", /* 63 */ "?", /* 64 */ "≅", /* 65 */ "Α", /* 66 */ "Β", /* 67 */ "Β", /* 68 */ "Δ", /* 69 */ "Ε", /* 70 */ "Φ", /* 71 */ "Γ", /* 72 */ "Η", /* 73 */ "Ι", /* 74 */ "ϑ", /* 75 */ "Κ", /* 76 */ "Λ", /* 77 */ "Μ", /* 78 */ "Ν", /* 79 */ "Ο", /* 80 */ "Π", /* 81 */ "Θ", /* 82 */ "Ρ", /* 83 */ "Σ", /* 84 */ "Τ", /* 85 */ "Υ", /* 86 */ "ς", /* 87 */ "Ω", /* 88 */ "Ξ", /* 89 */ "Ψ", /* 90 */ "Ζ", /* 91 */ "[", /* 92 */ "∴", /* 93 */ "]", /* 94 */ "⊥", /* 95 */ "_", /* 96 */ "‾", /* 97 */ "α", /* 98 */ "β", /* 99 */ "χ", /* 100 */ "δ", /* 101 */ "ε", /* 102 */ "φ", /* 103 */ "γ", /* 104 */ "η", /* 105 */ "ι", /* 106 */ "", /* ? */ /* 107 */ "κ", /* 108 */ "λ", /* 109 */ "μ", /* 110 */ "ν", /* 111 */ "ο", /* 112 */ "π", /* 113 */ "θ", /* 114 */ "ρ", /* 115 */ "σ", /* 116 */ "τ", /* 117 */ "υ", /* 118 */ "ϖ", /* 119 */ "ω", /* 120 */ "ξ", /* 121 */ "ψ", /* 122 */ "ζ", /* 123 */ "{", /* 124 */ "|", /* 125 */ "}", /* 126 */ "∼", /* 127 */ 0, /* 128 */ 0, /* 129 */ 0, /* 130 */ 0, /* 131 */ 0, /* 132 */ 0, /* 133 */ 0, /* 134 */ 0, /* 135 */ 0, /* 136 */ 0, /* 137 */ 0, /* 138 */ 0, /* 139 */ 0, /* 140 */ 0, /* 141 */ 0, /* 142 */ 0, /* 143 */ 0, /* 144 */ 0, /* 145 */ 0, /* 146 */ 0, /* 147 */ 0, /* 148 */ 0, /* 149 */ 0, /* 150 */ 0, /* 151 */ 0, /* 152 */ 0, /* 153 */ 0, /* 154 */ 0, /* 155 */ 0, /* 156 */ 0, /* 157 */ 0, /* 158 */ 0, /* 159 */ 0, /* 160 */ 0, /* 161 */ "ϒ", /* 162 */ "′", /* 163 */ "≤", /* 164 */ "⁄", /* 165 */ "∞", /* 166 */ "ƒ", /* 167 */ "♣", /* 168 */ "♦", /* 169 */ "♥", /* 170 */ "♠", /* 171 */ "↔", /* 172 */ "←", /* 173 */ 0, /* 174 */ "→", /* 175 */ "↓", /* 176 */ "°", /* 177 */ "±", /* 178 */ "″", /* 179 */ "≥", /* 180 */ "×", /* 181 */ "∝", /* 182 */ "∂", /* 183 */ "•", /* 184 */ "÷", /* 185 */ "≠", /* 186 */ "≡", /* 187 */ "≈", /* 188 */ "…", /* 189 */ "│", /* vertical line */ /* 190 */ "—", /* 191 */ "↵", /* 192 */ "ℵ", /* 193 */ "ℑ", /* 194 */ "ℜ", /* 195 */ "℘", /* 196 */ "⊗", /* 197 */ "⊕", /* 198 */ "∅", /* 199 */ "∩", /* 200 */ "∪", /* 201 */ "⊃", /* 202 */ "⊇", /* 203 */ "⊄", /* 204 */ "⊂", /* 205 */ "⊆", /* 206 */ "∈", /* 207 */ "∉", /* 208 */ "∠", /* 209 */ "∇", /* 210 */ "®", /* serif */ /* 211 */ "©", /* serif */ /* 212 */ "™", /* serif */ /* 213 */ "∏", /* 214 */ "√", /* 215 */ "·", /* 216 */ "¬", /* 217 */ "∧", /* 218 */ "∨", /* 219 */ "⇔", /* 220 */ "⇐", /* 221 */ "⇑", /* 222 */ "⇒", /* 223 */ "⇓", /* 224 */ "◊", /* 225 */ "⟨", /* 226 */ "®", /* sans serif */ /* 227 */ "©", /* sans serif */ /* 228 */ "™", /* sans serif */ /* 229 */ "∑", /* 230 */ 0, /* 231 */ 0, /* 232 */ 0, /* 233 */ "⌈", /* 234 */ "|", /* 235 */ "⌊", /* 236 */ 0, /* 237 */ 0, /* 238 */ 0, /* 239 */ "|", /* 240 */ "ð", /* 241 */ "⟩", /* 242 */ "∫", /* 243 */ 0, /* 244 */ 0, /* 245 */ 0, /* 246 */ 0, /* 247 */ 0, /* 248 */ 0, /* 249 */ "⌉", /* 250 */ "|", /* 251 */ "⌋", /* 252 */ 0, /* 253 */ 0, /* 254 */ 0, }; #endif static const char* cp437 [] = { /* 0x80 */ "ç", /* 0x81 */ "ü", /* 0x82 */ "é", /* 0x83 */ "â", /* 0x84 */ "ä", /* 0x85 */ "à", /* 0x86 */ "å", /* 0x87 */ "ç", /* 0x88 */ "ê", /* 0x89 */ "ë", /* 0x8a */ "è", /* 0x8b */ "ï", /* 0x8c */ "î", /* 0x8d */ "ì", /* 0x8e */ "ä", /* 0x8f */ "å", /* 0x90 */ "é", /* 0x91 */ "æ", /* 0x92 */ "æ", /* 0x93 */ "ô", /* 0x94 */ "ö", /* 0x95 */ "ò", /* 0x96 */ "û", /* 0x97 */ "ù", /* 0x98 */ "ÿ", /* 0x99 */ "ö", /* 0x9a */ "ü", /* 0x9b */ "¢", /* 0x9c */ "£", /* 0x9d */ "¥", /* 0x9e */ "₧", /* peseta */ /* 0x9f */ "ƒ", /* small f with hook */ /* 0xa0 */ "á", /* 0xa1 */ "í", /* 0xa2 */ "ó", /* 0xa3 */ "ú", /* 0xa4 */ "ñ", /* 0xa5 */ "ñ", /* 0xa6 */ "ª", /* 0xa7 */ "¼", /* 0xa8 */ "¿", /* 0xa9 */ "⌐", /* reversed not */ /* 0xaa */ "¬", /* 0xab */ "½", /* 0xac */ "»", /* 0xad */ "¡", /* 0xae */ "«", /* 0xaf */ "º", /* 0xb0 */ "░", /* light shade */ /* 0xb1 */ "▒", /* med. shade */ /* 0xb2 */ "▓", /* dark shade */ /* 0xb3 */ "│", /* box-draw light vert. */ /* 0xb4 */ "┤", /* box-draw light vert. + lt. */ /* 0xb5 */ "╡", /* box-draw vert. sgl. + lt. dbl. */ /* 0xb6 */ "╢", /* box-draw vert. dbl. + lt. sgl. */ /* 0xb7 */ "╖", /* box-draw dn. dbl. + lt. sgl. */ /* 0xb8 */ "╕", /* box-draw dn. sgl. + lt. dbl. */ /* 0xb9 */ "╣", /* box-draw dbl. vert. + lt. */ /* 0xba */ "║", /* box-draw dbl. vert. */ /* 0xbb */ "╗", /* box-draw dbl. dn. + lt. */ /* 0xbc */ "╝", /* box-draw dbl. up + lt. */ /* 0xbd */ "╜", /* box-draw up dbl. + lt. sgl. */ /* 0xbe */ "╛", /* box-draw up sgl. + lt. dbl. */ /* 0xbf */ "┐", /* box-draw light dn. + lt. */ /* 0xc0 */ "└", /* box-draw light up + rt. */ /* 0xc1 */ "┴", /* box-draw light up + horiz. */ /* 0xc2 */ "┬", /* box-draw light dn. + horiz. */ /* 0xc3 */ "├", /* box-draw light vert. + rt. */ /* 0xc4 */ "─", /* box-draw light horiz. */ /* 0xc5 */ "┼", /* box-draw light vert. + horiz. */ /* 0xc6 */ "╞", /* box-draw vert. sgl. + rt. dbl. */ /* 0xc7 */ "╟", /* box-draw vert. dbl. + rt. sgl. */ /* 0xc8 */ "╚", /* box-draw dbl. up + rt. */ /* 0xc9 */ "╔", /* box-draw dbl. dn. + rt. */ /* 0xca */ "╩", /* box-draw dbl. up + horiz. */ /* 0xcb */ "╦", /* box-draw dbl. dn. + horiz. */ /* 0xcc */ "╠", /* box-draw dbl. vert. + rt. */ /* 0xcd */ "═", /* box-draw dbl. horiz. */ /* 0xce */ "╬", /* box-draw dbl. vert. + horiz. */ /* 0xcf */ "╧", /* box-draw up sgl. + horiz. dbl. */ /* 0xd0 */ "╨", /* box-draw up dbl. + horiz. sgl. */ /* 0xd1 */ "╤", /* box-draw dn. sgl. + horiz. dbl. */ /* 0xd2 */ "╥", /* box-draw dn. dbl. + horiz. sgl. */ /* 0xd3 */ "╙", /* box-draw up dbl. + rt. sgl. */ /* 0xd4 */ "╘", /* box-draw up sgl. + rt. dbl. */ /* 0xd5 */ "╒", /* box-draw dn. sgl. + rt. dbl. */ /* 0xd6 */ "╓", /* box-draw dn. dbl. + rt. sgl. */ /* 0xd7 */ "╫", /* box-draw vert. dbl. + horiz. sgl. */ /* 0xd8 */ "╪", /* box-draw vert. sgl. + horiz. dbl. */ /* 0xd9 */ "┘", /* box-draw light up + lt. */ /* 0xda */ "┌", /* box-draw light dn. + rt. */ /* 0xdb */ "█", /* full block */ /* 0xdc */ "▄", /* lower 1/2 block */ /* 0xdd */ "▌", /* lt. 1/2 block */ /* 0xde */ "▐", /* rt. 1/2 block */ /* 0xdf */ "▀", /* upper 1/2 block */ /* 0xe0 */ "α", /* greek small alpha */ /* 0xe1 */ "ß", /* 0xe2 */ "Γ", /* greek cap gamma */ /* 0xe3 */ "π", /* greek small pi */ /* 0xe4 */ "Σ", /* greek cap sigma */ /* 0xe5 */ "σ", /* greek small sigma */ /* 0xe6 */ "µ", /* 0xe7 */ "τ", /* greek small tau */ /* 0xe8 */ "Φ", /* greek cap phi */ /* 0xe9 */ "Θ", /* greek cap theta */ /* 0xea */ "Ω", /* greek cap omega */ /* 0xeb */ "δ", /* greek small delta */ /* 0xec */ "∞", /* inf. */ /* 0xed */ "φ", /* greek small phi */ /* 0xee */ "ε", /* greek small epsilon */ /* 0xef */ "∩", /* intersect */ /* 0xf0 */ "≡", /* identical */ /* 0xf1 */ "±", /* 0xf2 */ "≥", /* greater-than or equal to */ /* 0xf3 */ "≤", /* less-than or equal to */ /* 0xf4 */ "⌠", /* top 1/2 integral */ /* 0xf5 */ "⌡", /* bottom 1/2 integral */ /* 0xf6 */ "÷", /* 0xf7 */ "≈", /* almost = */ /* 0xf8 */ "+", /* 0xf9 */ "∙", /* bullet op */ /* 0xfa */ "·", /* 0xfb */ "√", /* sqrt */ /* 0xfc */ "ⁿ", /* super-script small n */ /* 0xfd */ "²", /* 0xfe */ "■", /* black square */ /* 0xff */ " ", }; static const char* cp850 [] = { /* 0x80 */ "ç", /* 0x81 */ "ü", /* 0x82 */ "é", /* 0x83 */ "â", /* 0x84 */ "ä", /* 0x85 */ "à", /* 0x86 */ "å", /* 0x87 */ "ç", /* 0x88 */ "ê", /* 0x89 */ "ë", /* 0x8a */ "è", /* 0x8b */ "ï", /* 0x8c */ "î", /* 0x8d */ "ì", /* 0x8e */ "ä", /* 0x8f */ "å", /* 0x90 */ "é", /* 0x91 */ "æ", /* 0x92 */ "æ", /* 0x93 */ "ô", /* 0x94 */ "ö", /* 0x95 */ "ò", /* 0x96 */ "û", /* 0x97 */ "ù", /* 0x98 */ "ÿ", /* 0x99 */ "ö", /* 0x9a */ "ü", /* 0x9b */ "ø", /* 0x9c */ "£", /* 0x9d */ "ø", /* 0x9e */ "×", /* 0x9f */ "ƒ", /* small f with hook */ /* 0xa0 */ "á", /* 0xa1 */ "í", /* 0xa2 */ "ó", /* 0xa3 */ "ú", /* 0xa4 */ "ñ", /* 0xa5 */ "ñ", /* 0xa6 */ "ª", /* 0xa7 */ "¼", /* 0xa8 */ "¿", /* 0xa9 */ "®", /* 0xaa */ "¬", /* 0xab */ "½", /* 0xac */ "»", /* 0xad */ "¡", /* 0xae */ "«", /* 0xaf */ "º", /* 0xb0 */ "░", /* light shade */ /* 0xb1 */ "▒", /* med. shade */ /* 0xb2 */ "▓", /* dark shade */ /* 0xb3 */ "│", /* box-draw light vert. */ /* 0xb4 */ "┤", /* box-draw light vert. + lt. */ /* 0xb5 */ "á", /* 0xb6 */ "â", /* 0xb7 */ "à", /* 0xb8 */ "©", /* 0xb9 */ "╣", /* box-draw dbl. vert. + lt. */ /* 0xba */ "║", /* box-draw dbl. vert. */ /* 0xbb */ "╗", /* box-draw dbl. dn. + lt. */ /* 0xbc */ "╝", /* box-draw dbl. up + lt. */ /* 0xbd */ "¢", /* 0xbe */ "¥", /* 0xbf */ "┐", /* box-draw light dn. + lt. */ /* 0xc0 */ "└", /* box-draw light up + rt. */ /* 0xc1 */ "┴", /* box-draw light up + horiz. */ /* 0xc2 */ "┬", /* box-draw light dn. + horiz. */ /* 0xc3 */ "├", /* box-draw light vert. + rt. */ /* 0xc4 */ "─", /* box-draw light horiz. */ /* 0xc5 */ "┼", /* box-draw light vert. + horiz. */ /* 0xc6 */ "ã", /* 0xc7 */ "ã", /* 0xc8 */ "╚", /* box-draw dbl. up + rt. */ /* 0xc9 */ "╔", /* box-draw dbl. dn. + rt. */ /* 0xca */ "╩", /* box-draw dbl. up + horiz. */ /* 0xcb */ "╦", /* box-draw dbl. dn. + horiz. */ /* 0xcc */ "╠", /* box-draw dbl. vert. + rt. */ /* 0xcd */ "═", /* box-draw dbl. horiz. */ /* 0xce */ "╬", /* box-draw dbl. vert. + horiz. */ /* 0xcf */ "¤", /* 0xd0 */ "ð", /* 0xd1 */ "ð", /* 0xd2 */ "ê", /* 0xd3 */ "ë", /* 0xd4 */ "è", /* 0xd5 */ "ı", /* small dotless i */ /* 0xd6 */ "í", /* 0xd7 */ "î", /* 0xd8 */ "ï", /* 0xd9 */ "┘", /* box-draw light up + lt. */ /* 0xda */ "┌", /* box-draw light dn. + rt. */ /* 0xdb */ "█", /* full-block */ /* 0xdc */ "▄", /* lower 1/2 block */ /* 0xdd */ "¦", /* 0xde */ "ì", /* 0xdf */ "▀", /* upper 1/2 block */ /* 0xe0 */ "ó", /* 0xe1 */ "ß", /* 0xe2 */ "ô", /* 0xe3 */ "ò", /* 0xe4 */ "õ", /* 0xe5 */ "õ", /* 0xe6 */ "µ", /* 0xe7 */ "þ", /* 0xe8 */ "þ", /* 0xe9 */ "ú", /* 0xea */ "û", /* 0xeb */ "ù", /* 0xec */ "ý", /* 0xed */ "ý", /* 0xee */ "¯", /* 0xef */ "´", /* 0xf0 */ "­", /* 0xf1 */ "±", /* 0xf2 */ "‗", /* dbl. lowline */ /* 0xf3 */ "¾", /* 0xf4 */ "¶", /* 0xf5 */ "§", /* 0xf6 */ "÷", /* 0xf7 */ "¸", /* 0xf8 */ "+", /* 0xf9 */ "¨", /* 0xfa */ "·", /* 0xfb */ "¹", /* 0xfc */ "³", /* 0xfd */ "²", /* 0xfe */ "■", /* black square */ /* 0xff */ " ", }; #if 1 /* daved - 0.20.3 */ static const char * Greek[] = { /* 0x80 */ "ç", /* 0x81 */ "ü", /* 0x82 */ "é", /* 0x83 */ "â", /* 0x84 */ "ä", /* 0x85 */ "à", /* 0x86 */ "å", /* 0x87 */ "ç", /* 0x88 */ "ê", /* 0x89 */ "ë", /* 0x8a */ "è", /* 0x8b */ "ï", /* 0x8c */ "î", /* 0x8d */ "ì", /* 0x8e */ "ä", /* 0x8f */ "å", /* 0x90 */ "é", /* 0x91 */ "æ", /* 0x92 */ "æ", /* 0x93 */ "ô", /* 0x94 */ "ö", /* 0x95 */ "ò", /* 0x96 */ "û", /* 0x97 */ "ù", /* 0x98 */ "ÿ", /* 0x99 */ "ö", /* 0x9a */ "ü", /* 0x9b */ "ø", /* 0x9c */ "£", /* 0x9d */ "ø", /* 0x9e */ "×", /* 0x9f */ "ƒ", /* small f with hook */ /* 0xa0 */ "á", /* 0xa1 */ "í", /* 0xa2 */ "ó", /* 0xa3 */ "ú", /* 0xa4 */ "ñ", /* 0xa5 */ "ñ", /* 0xa6 */ "ª", /* 0xa7 */ "¼", /* 0xa8 */ "¿", /* 0xa9 */ "®", /* 0xaa */ "¬", /* 0xab */ "½", /* 0xac */ "»", /* 0xad */ "¡", /* 0xae */ "«", /* 0xaf */ "º", /* 0xb0 */ "░", /* light shade */ /* 0xb1 */ "▒", /* med. shade */ /* 0xb2 */ "▓", /* dark shade */ /* 0xb3 */ "│", /* box-draw light vert. */ /* 0xb4 */ "┤", /* box-draw light vert. + lt. */ /* 0xb5 */ "á", /* 0xb6 */ "â", /* 0xb7 */ "à", /* 0xb8 */ "©", /* 0xb9 */ "╣", /* box-draw dbl. vert. + lt. */ /* 0xba */ "║", /* box-draw dbl. vert. */ /* 0xbb */ "╗", /* box-draw dbl. dn. + lt. */ /* 0xbc */ "╝", /* box-draw dbl. up + lt. */ /* 0xbd */ "¢", /* 0xbe */ "¥", /* 0xbf */ "┐", /* box-draw light dn. + lt. */ /* 0xc0 */ "└", /* box-draw light up + rt. */ /* 0xc1 */ "┴", /* box-draw light up + horiz. */ /* 0xc2 */ "┬", /* box-draw light dn. + horiz. */ /* 0xc3 */ "├", /* box-draw light vert. + rt. */ /* 0xc4 */ "─", /* box-draw light horiz. */ /* 0xc5 */ "┼", /* box-draw light vert. + horiz. */ /* 0xc6 */ "ã", /* 0xc7 */ "ã", /* 0xc8 */ "╚", /* box-draw dbl. up + rt. */ /* 0xc9 */ "╔", /* box-draw dbl. dn. + rt. */ /* 0xca */ "╩", /* box-draw dbl. up + horiz. */ /* 0xcb */ "╦", /* box-draw dbl. dn. + horiz. */ /* 0xcc */ "╠", /* box-draw dbl. vert. + rt. */ /* 0xcd */ "═", /* box-draw dbl. horiz. */ /* 0xce */ "╬", /* box-draw dbl. vert. + horiz. */ /* 0xcf */ "¤", /* 0xd0 */ "ð", /* 0xd1 */ "ð", /* 0xd2 */ "ê", /* 0xd3 */ "ë", /* 0xd4 */ "è", /* 0xd5 */ "ı", /* small dotless i */ /* 0xd6 */ "í", /* 0xd7 */ "î", /* 0xd8 */ "ï", /* 0xd9 */ "┘", /* box-draw light up + lt. */ /* 0xda */ "┌", /* box-draw light dn. + rt. */ /* 0xdb */ "█", /* full-block */ /* 0xdc */ "▄", /* lower 1/2 block */ /* 0xdd */ "¦", /* 0xde */ "ì", /* 0xdf */ "▀", /* upper 1/2 block */ /* 0xe0 */ "ó", /* above here not done */ /* 0xe1 */ "α", /* 0xe2 */ "β", /* 0xe3 */ "γ", /* 0xe4 */ "δ", /* 0xe5 */ "ε", /* 0xe6 */ "ζ", /* 0xe7 */ "η", /* 0xe8 */ "θ", /* 0xe9 */ "ι", /* 0xea */ "κ", /* 0xeb */ "λ", /* 0xec */ "μ", /* 0xed */ "ν", /* 0xee */ "ξ", /* 0xef */ "ο", /* 0xf0 */ "π", /* 0xf1 */ "ρ", /* 0xf2 */ "ς", /* 0xf3 */ "σ", /* 0xf4 */ "τ", /* 0xf5 */ "υ", /* 0xf6 */ "φ", /* 0xf7 */ "χ", /* 0xf8 */ "ψ", /* 0xf9 */ "&omiga;", /* 0xfa */ "&iotauml;", /* 0xfb */ "&nuuml;", /* 0xfc */ "&omicronacute;", /* 0xfd */ "&nuacute;", /* 0xfe */ "&omegaacute;", /* black square */ /* 0xff */ " ", }; #endif /*======================================================================== * Name: html_unisymbol_print * Purpose: Outputs arbitrary unicode symbol * Args: Unsigned Short. * Returns: String representing symbol. *=======================================================================*/ char * html_unisymbol_print (unsigned short c) { char r[12]; snprintf(r, 9, "&#%04d;", c); return my_strdup(r); } /*======================================================================== * Name: html_init * Purpose: Generates the HTML output personality. * Args: None. * Returns: OutputPersonality. *=======================================================================*/ OutputPersonality * html_init (void) { OutputPersonality* op; op = op_create(); op->comment_begin = "\n"; op->document_begin = "\n\n"; op->document_end = "\n"; op->header_begin = "\n"; op->header_end = "\n"; op->document_title_begin = ""; op->document_title_end = "\n"; op->document_author_begin = "\n"; op->document_changedate_begin = "\n"; op->body_begin = ""; op->body_end = "\n"; op->paragraph_begin = "

"; op->paragraph_end = "

\n"; op->center_begin = "
"; op->center_end = "
\n"; op->justify_begin = "
\n"; op->justify_end = "
\n"; op->align_left_begin = "
\n"; op->align_left_end = "
\n"; op->align_right_begin = "
\n"; op->align_right_end = "
\n"; op->forced_space = " "; op->line_break = "
\n"; op->page_break = "


\n"; op->hyperlink_begin = "hyperlink_end = "\">hyperlink"; op->imagelink_begin = "imagelink_end = "\">"; op->table_begin = "\n"; op->table_end = "
\n"; op->table_row_begin = ""; op->table_row_end = "\n"; op->table_cell_begin = ""; op->table_cell_end = "\n"; /* Character attributes */ op->font_begin = ""; op->font_end = ""; op->fontsize_begin = ""; op->fontsize_end = ""; op->fontsize8_begin = ""; op->fontsize8_end = ""; op->fontsize10_begin = ""; op->fontsize10_end = ""; op->fontsize12_begin = ""; op->fontsize12_end = ""; op->fontsize14_begin = ""; op->fontsize14_end = ""; op->fontsize18_begin = ""; op->fontsize18_end = ""; op->fontsize24_begin = ""; op->fontsize24_end = ""; op->smaller_begin = ""; op->smaller_end = ""; op->bigger_begin = ""; op->bigger_end = ""; op->foreground_begin = ""; op->foreground_end = ""; op->background_begin = ""; op->background_end = ""; op->bold_begin = ""; op->bold_end = ""; op->italic_begin = ""; op->italic_end = ""; op->underline_begin = ""; op->underline_end = ""; op->dbl_underline_begin = ""; op->dbl_underline_end = ""; op->superscript_begin = ""; op->superscript_end = ""; op->subscript_begin = ""; op->subscript_end = ""; op->strikethru_begin = ""; op->strikethru_end = ""; op->dbl_strikethru_begin = ""; op->dbl_strikethru_end = ""; op->emboss_begin=""; op->emboss_end = ""; op->engrave_begin = ""; op->engrave_end = ""; op->shadow_begin= ""; op->shadow_end= ""; op->outline_begin= ""; op->outline_end= ""; op->expand_begin = ""; op->expand_end = ""; op->pointlist_begin = "

    \n"; op->pointlist_end = "
\n"; op->pointlist_item_begin = "
  • "; op->pointlist_item_end = "
  • \n"; op->numericlist_begin = "
      \n"; op->numericlist_end = "
    \n"; op->numericlist_item_begin = "
  • "; op->numericlist_item_end = "
  • \n"; op->simulate_small_caps = true; op->simulate_all_caps = true; op->simulate_word_underline = true; op->ascii_translation_table = ascii; op->ansi_translation_table = ansi; #if 1 /* daved - 0.9.6 */ op->ansi_first_char = 0x78; #else op->ansi_first_char = 0x82; #endif op->ansi_last_char = 0xff; op->cp437_translation_table = cp437; op->cp437_first_char = 0x80; op->cp437_last_char = 0xff; op->cp850_translation_table = cp850; op->cp850_first_char = 0x80; op->cp850_last_char = 0xff; op->mac_translation_table = mac; op->mac_first_char = 0xa4; op->mac_last_char = 0xd5; #if 1 /* daved 0.19.8 */ op->chars.right_quote = "’"; op->chars.left_quote = "‘"; op->chars.right_dbl_quote = "”"; op->chars.left_dbl_quote = "“"; #else op->chars.right_quote = "'"; op->chars.left_quote = "`"; op->chars.right_dbl_quote = "\""; op->chars.left_dbl_quote = "\""; #endif #if 1 /* daved - 0.19.8 */ op->chars.endash = "–"; op->chars.emdash = "—"; op->chars.bullet = "•"; op->chars.lessthan = "<"; op->chars.greaterthan = ">"; op->chars.amp = "&"; op->chars.copyright = "©"; op->chars.trademark = "™"; op->chars.nonbreaking_space = " "; #endif #if 1 /* daved - 0.19.4 - unicode symbol character support */ op->unisymbol1_first_char = 913; op->unisymbol1_last_char = 982; op->unisymbol1_translation_table = unisymbol1; op->unisymbol2_first_char = 57516; op->unisymbol2_last_char = 57557; op->unisymbol2_translation_table = unisymbol2; op->unisymbol3_first_char = 61505; op->unisymbol3_last_char = 61562; op->unisymbol3_translation_table = unisymbol3; #endif #if 1 /* daved - 0.19.5 - more unicode symbol character support */ op->unisymbol4_first_char = 61600; op->unisymbol4_last_char = 61694; op->unisymbol4_translation_table = unisymbol4; #endif #if 1 /* daved - 0.19.5 - SYMBOL font support */ op->symbol_first_char = 60; op->symbol_last_char = 254; op->symbol_translation_table = symbol; #endif #if 1 /* daved - 0.20.3 - GREEK font support */ op->greek_first_char = 0x80; op->greek_last_char = 0xff; op->greek_translation_table = Greek; #endif op->unisymbol_print = html_unisymbol_print; return op; }