REBOL [
    Title: "Color REBOL Code in HTML"
    Date: 29-May-2003
    File: %color-code.r
    Home: http://www.ross-gill.com/
    Rights: {
        Copyright 2003 Christopher Ross-Gill.  Some rights reserved.
    }
    Purpose: {
        To provide reliable mapping of 8-bit character sets to their
        ISO-10646 counterparts for use in XML and XHTML applications
        amongst others.
    }
    Usage: {
        To Follow...
    }
    Comment: {
        This generally deals with all character values above 127 (ascii).
        Though the escapes for "&<> have been included in the tables that
        are of use to (X)HTML.  Ascii values are common between all
        character sets here.
    }
]

comment {
    All ISO-10646 Characters that are valid in (X)HTML with entities that
    (should in theory) work with browsers that include Netscape 4.
}

xhtml10646: [
    34 #quot 38 #amp 60 #lt 62 #gt 160 #nbsp 161 #iexcl 162 #cent
    163 #pound 164 #curren 165 #yen 166 #brvbar 167 #sect 168 #uml
    169 #copy 170 #ordf 171 #laquo 172 #not 173 #shy 174 #reg 175 #macr
    176 #deg 177 #plusmn 178 #sup2 179 #sup3 180 #acute 181 #micro
    182 #para 183 #middot 184 #cedil 185 #sup1 186 #ordm 187 #raquo
    188 #frac14 189 #frac12 190 #frac34 191 #iquest 192 #Agrave
    193 #Aacute 194 #Acirc 195 #Atilde 196 #Auml 197 #Aring 198 #AElig
    199 #Ccedil 200 #Egrave 201 #Eacute 202 #Ecirc 203 #Euml 204 #Igrave
    205 #Iacute 206 #Icirc 207 #Iuml 208 #ETH 209 #Ntilde 210 #Ograve
    211 #Oacute 212 #Ocirc 213 #Otilde 214 #Ouml 215 #times 216 #Oslash
    217 #Ugrave 218 #Uacute 219 #Ucirc 220 #Uuml 221 #Yacute 222 #THORN
    223 #szlig 224 #agrave 225 #aacute 226 #acirc 227 #atilde 228 #auml
    229 #aring 230 #aelig 231 #ccedil 232 #egrave 233 #eacute 234 #ecirc
    235 #euml 236 #igrave 237 #iacute 238 #icirc 239 #iuml 240 #eth
    241 #ntilde 242 #ograve 243 #oacute 244 #ocirc 245 #otilde 246 #ouml
    247 #divide 248 #oslash 249 #ugrave 250 #uacute 251 #ucirc 252 #uuml
    253 #yacute 254 #thorn 255 #yuml 338 ##338 339 ##339 352 ##352
    353 ##353 376 ##376 402 ##402 710 ##710 732 ##732 913 ##913
    914 ##914 915 ##915 916 ##916 917 ##917 918 ##918 919 ##919
    920 ##920 921 ##921 922 ##922 923 ##923 924 ##924 925 ##925
    926 ##926 927 ##927 928 ##928 929 ##929 931 ##931 932 ##932
    933 ##933 934 ##934 935 ##935 936 ##936 937 ##937 945 ##945
    946 ##946 947 ##947 948 ##948 949 ##949 950 ##950 951 ##951
    952 ##952 953 ##953 954 ##954 955 ##955 956 ##956 957 ##957
    958 ##958 959 ##959 960 ##960 961 ##961 962 ##962 963 ##963
    964 ##964 965 ##965 966 ##966 967 ##967 968 ##968 969 ##969
    977 ##977 978 ##978 982 ##982 8194 ##8194 8195 ##8195 8201 ##8201
    8204 ##8204 8205 ##8205 8206 ##8206 8207 ##8207 8211 ##8211
    8212 ##8212 8216 ##8216 8217 ##8217 8218 ##8218 8220 ##8220
    8221 ##8221 8222 ##8222 8224 ##8224 8225 ##8225 8226 ##8226
    8230 ##8230 8240 ##8240 8242 ##8242 8243 ##8243 8249 ##8249
    8250 ##8250 8254 ##8254 8260 ##8260 8364 ##8364 8465 ##8465
    8472 ##8472 8476 ##8476 8482 ##8482 8501 ##8501 8592 ##8592
    8593 ##8593 8594 ##8594 8595 ##8595 8596 ##8596 8629 ##8629
    8656 ##8656 8657 ##8657 8658 ##8658 8659 ##8659 8660 ##8660
    8704 ##8704 8706 ##8706 8707 ##8707 8709 ##8709 8711 ##8711
    8712 ##8712 8713 ##8713 8715 ##8715 8719 ##8719 8721 ##8721
    8722 ##8722 8727 ##8727 8730 ##8730 8733 ##8733 8734 ##8734
    8736 ##8736 8743 ##8743 8744 ##8744 8745 ##8745 8746 ##8746
    8747 ##8747 8756 ##8756 8764 ##8764 8773 ##8773 8776 ##8776
    8800 ##8800 8801 ##8801 8804 ##8804 8805 ##8805 8834 ##8834
    8835 ##8835 8836 ##8836 8838 ##8838 8839 ##8839 8853 ##8853
    8855 ##8855 8869 ##8869 8901 ##8901 8968 ##8968 8969 ##8969
    8970 ##8970 8971 ##8971 9001 ##9001 9002 ##9002 9674 ##9674
    9824 ##9824 9827 ##9827 9829 ##9829 9830 ##9830
]

comment {
    All ISO-10646 Characters that are valid in (X)HTML with entity names
}

xhtml10646-entitynames: [
    34 #quot 38 #amp 60 #lt 62 #gt 160 #nbsp 161 #iexcl 162 #cent
    163 #pound 164 #curren 165 #yen 166 #brvbar 167 #sect 168 #uml
    169 #copy 170 #ordf 171 #laquo 172 #not 173 #shy 174 #reg 175 #macr
    176 #deg 177 #plusmn 178 #sup2 179 #sup3 180 #acute 181 #micro
    182 #para 183 #middot 184 #cedil 185 #sup1 186 #ordm 187 #raquo
    188 #frac14 189 #frac12 190 #frac34 191 #iquest 192 #Agrave
    193 #Aacute 194 #Acirc 195 #Atilde 196 #Auml 197 #Aring 198 #AElig
    199 #Ccedil 200 #Egrave 201 #Eacute 202 #Ecirc 203 #Euml 204 #Igrave
    205 #Iacute 206 #Icirc 207 #Iuml 208 #ETH 209 #Ntilde 210 #Ograve
    211 #Oacute 212 #Ocirc 213 #Otilde 214 #Ouml 215 #times 216 #Oslash
    217 #Ugrave 218 #Uacute 219 #Ucirc 220 #Uuml 221 #Yacute 222 #THORN
    223 #szlig 224 #agrave 225 #aacute 226 #acirc 227 #atilde 228 #auml
    229 #aring 230 #aelig 231 #ccedil 232 #egrave 233 #eacute 234 #ecirc
    235 #euml 236 #igrave 237 #iacute 238 #icirc 239 #iuml 240 #eth
    241 #ntilde 242 #ograve 243 #oacute 244 #ocirc 245 #otilde 246 #ouml
    247 #divide 248 #oslash 249 #ugrave 250 #uacute 251 #ucirc 252 #uuml
    253 #yacute 254 #thorn 255 #yuml 338 #OElig 339 #oelig 352 #Scaron
    353 #scaron 376 #Yuml 402 #fnof 710 #circ 732 #tilde 913 #Alpha
    914 #Beta 915 #Gamma 916 #Delta 917 #Epsilon 918 #Zeta 919 #Eta
    920 #Theta 921 #Iota 922 #Kappa 923 #Lambda 924 #Mu 925 #Nu 926 #Xi
    927 #Omicron 928 #Pi 929 #Rho 931 #Sigma 932 #Tau 933 #Upsilon
    934 #Phi 935 #Chi 936 #Psi 937 #Omega 945 #alpha 946 #beta 947 #gamma
    948 #delta 949 #epsilon 950 #zeta 951 #eta 952 #theta 953 #iota
    954 #kappa 955 #lambda 956 #mu 957 #nu 958 #xi 959 #omicron 960 #pi
    961 #rho 962 #sigmaf 963 #sigma 964 #tau 965 #upsilon 966 #phi
    967 #chi 968 #psi 969 #omega 977 #thetasym 978 #upsih 982 #piv
    8194 #ensp 8195 #emsp 8201 #thinsp 8204 #zwnj 8205 #zwj 8206 #lrm
    8207 #rlm 8211 #ndash 8212 #mdash 8216 #lsquo 8217 #rsquo 8218 #sbquo
    8220 #ldquo 8221 #rdquo 8222 #bdquo 8224 #dagger 8225 #Dagger
    8226 #bull 8230 #hellip 8240 #permil 8242 #prime 8243 #Prime
    8249 #lsaquo 8250 #rsaquo 8254 #oline 8260 #frasl 8364 #euro
    8465 #image 8472 #weierp 8476 #real 8482 #trade 8501 #alefsym
    8592 #larr 8593 #uarr 8594 #rarr 8595 #darr 8596 #harr 8629 #crarr
    8656 #lArr 8657 #uArr 8658 #rArr 8659 #dArr 8660 #hArr 8704 #forall
    8706 #part 8707 #exist 8709 #empty 8711 #nabla 8712 #isin 8713 #notin
    8715 #ni 8719 #prod 8721 #sum 8722 #minus 8727 #lowast 8730 #radic
    8733 #prop 8734 #infin 8736 #ang 8743 #and 8744 #or 8745 #cap
    8746 #cup 8747 #int 8756 #there4 8764 #sim 8773 #cong 8776 #asymp
    8800 #ne 8801 #equiv 8804 #le 8805 #ge 8834 #sub 8835 #sup 8836 #nsub
    8838 #sube 8839 #supe 8853 #oplus 8855 #otimes 8869 #perp 8901 #sdot
    8968 #lceil 8969 #rceil 8970 #lfloor 8971 #rfloor 9001 #lang
    9002 #rang 9674 #loz 9824 #spades 9827 #clubs 9829 #hearts 9830 #diams
]

comment {
    Maps characters from a Windows generated file to XHTML
}

windows1252-to-xhtml: [
    34 #quot 38 #amp 60 #lt 62 #gt
    128 #euro 130 ##8218 131 ##402 132 ##8222 133 ##8230 134 ##8224
    135 ##8225 136 ##710 137 ##8240 138 ##352 139 ##8249 140 ##338
    145 ##8216 146 ##8217 147 ##8220 148 ##8221 149 ##8226 150 ##8211
    151 ##8212 152 ##732 153 ##8482 154 ##353 155 ##8250 156 ##339
    159 ##376 160 #nbsp 161 #iexcl 162 #cent 163 #pound 164 #curren
    165 #yen 166 #brvbar 167 #sect 168 #uml 169 #copy 170 #ordf
    171 #laquo 172 #not 173 #shy 174 #reg 175 #macr 176 #deg
    177 #plusmn 178 #sup2 179 #sup3 180 #acute 181 #micro 182 #para
    183 #middot 184 #cedil 185 #sup1 186 #ordm 187 #raquo 188 #frac14
    189 #frac12 190 #frac34 191 #iquest 192 #Agrave 193 #Aacute
    194 #Acirc 195 #Atilde 196 #Auml 197 #Aring 198 #AElig 199 #Ccedil
    200 #Egrave 201 #Eacute 202 #Ecirc 203 #Euml 204 #Igrave 205 #Iacute
    206 #Icirc 207 #Iuml 208 #ETH 209 #Ntilde 210 #Ograve 211 #Oacute
    212 #Ocirc 213 #Otilde 214 #Ouml 215 #times 216 #Oslash 217 #Ugrave
    218 #Uacute 219 #Ucirc 220 #Uuml 221 #Yacute 222 #THORN 223 #szlig
    224 #agrave 225 #aacute 226 #acirc 227 #atilde 228 #auml 229 #aring
    230 #aelig 231 #ccedil 232 #egrave 233 #eacute 234 #ecirc 235 #euml
    236 #igrave 237 #iacute 238 #icirc 239 #iuml 240 #eth 241 #ntilde
    242 #ograve 243 #oacute 244 #ocirc 245 #otilde 246 #ouml 247 #divide
    248 #oslash 249 #ugrave 250 #uacute 251 #ucirc 252 #uuml 253 #yacute
    254 #thorn 255 #yuml
]

comment {
    Maps characters from a Mac generated file to XHTML
}

macroman-to-xhtml: [
    34 #quot 38 #amp 60 #lt 62 #gt
    128 #Auml 129 #Aring 130 #Ccedil 131 #Eacute 132 #Ntilde 133 #Ouml
    134 #Uuml 135 #aacute 136 #agrave 137 #acirc 138 #auml 139 #atilde
    140 #aring 141 #ccedil 142 #eacute 143 #egrave 144 #ecirc 145 #euml
    146 #iacute 147 #igrave 148 #icirc 149 #iuml 150 #ntilde 151 #oacute
    152 #ograve 153 #ocirc 154 #ouml 155 #otilde 156 #uacute 157 #ugrave
    158 #ucirc 159 #uuml 160 ##8224 161 #deg 162 #cent 163 #pound
    164 #sect 165 ##8226 166 #para 167 #szlig 168 #reg 169 #copy
    170 ##8482 171 #acute 172 #uml 173 ##8800 174 #AElig 175 #Oslash
    176 ##8734 177 #plusmn 178 ##8804 179 ##8805 180 #yen 181 #micro
    182 ##8706 183 ##8721 184 ##8719 185 ##960 186 ##8747 187 #ordf
    188 #ordm 189 ##937 190 #aelig 191 #oslash 192 #iquest 193 #iexcl
    194 #not 195 ##8730 196 ##402 197 ##8776 199 #laquo 200 #raquo
    201 ##8230 202 #nbsp 203 #Agrave 204 #Atilde 205 #Otilde 206 ##338
    207 ##339 208 ##8211 209 ##8212 210 ##8220 211 ##8221 212 ##8216
    213 ##8217 214 #divide 215 ##9674 216 #yuml 217 ##376 218 ##8260
    219 #euro 220 ##8249 221 ##8250 224 ##8225 225 #middot 226 ##8218
    227 ##8222 228 ##8240 229 #Acirc 230 #Ecirc 231 #Aacute 232 #Euml
    233 #Egrave 234 #Iacute 235 #Icirc 236 #Iuml 237 #Igrave 238 #Oacute
    239 #Ocirc 241 #Ograve 242 #Uacute 243 #Ucirc 244 #Ugrave 246 ##710
    247 ##732 248 #macr 252 #cedil
]

comment {
    Maps characters from a Windows generated file to ISO-10646
}

windows1252-to-iso10646: [
    128 8364  130 8218  131 402  132 8222  133 8230  134 8224
    135 8225  136 710  137 8240  138 352  139 8249  140 338  142 381
    145 8216  146 8217  147 8220  148 8221  149 8226  150 8211
    151 8212  152 732  153 8482  154 353  155 8250  156 339 158 382
    159 376  160 160  161 161  162 162  163 163  164 164  165 165
    166 166  167 167  168 168  169 169  170 170  171 171  172 172
    173 173  174 174  175 175  176 176  177 177  178 178  179 179
    180 180  181 181  182 182  183 183  184 184  185 185  186 186
    187 187  188 188  189 189  190 190  191 191  192 192  193 193
    194 194  195 195  196 196  197 197  198 198  199 199  200 200
    201 201  202 202  203 203  204 204  205 205  206 206  207 207
    208 208  209 209  210 210  211 211  212 212  213 213  214 214
    215 215  216 216  217 217  218 218  219 219  220 220  221 221
    222 222  223 223  224 224  225 225  226 226  227 227  228 228
    229 229  230 230  231 231  232 232  233 233  234 234  235 235
    236 236  237 237  238 238  239 239  240 240  241 241  242 242
    243 243  244 244  245 245  246 246  247 247  248 248  249 249
    250 250  251 251  252 252  253 253  254 254  255 255
]

comment {
    Maps characters from a Mac generated file to ISO-10646
}

macroman-to-iso10646: [
    128 196  129 197  130 199  131 201  132 209  133 214  134 220
    135 225  136 224  137 226  138 228  139 227  140 229  141 231
    142 233  143 232  144 234  145 235  146 237  147 236  148 238
    149 239  150 241  151 243  152 242  153 244  154 246  155 245
    156 250  157 249  158 251  159 252  160 8224  161 176  162 162
    163 163  164 167  165 8226  166 182  167 223  168 174  169 169
    170 8482  171 180  172 168  173 8800  174 198  175 216  176 8734
    177 177  178 8804  179 8805  180 165  181 181  182 8706  183 8721
    184 8719  185 960  186 8747  187 170  188 186  189 937  190 230
    191 248  192 191  193 161  194 172  195 8730  196 402  197 8776
    198 8710  199 171  200 187  201 8230  202 160  203 192  204 195
    205 213  206 338  207 339  208 8211  209 8212  210 8220  211 8221
    212 8216  213 8217  214 247  215 9674  216 255  217 376  218 8260
    219 8364  220 8249  221 8250  222 64257  223 64258  224 8225  225 183
    226 8218  227 8222  228 8240  229 194  230 202  231 193  232 203
    233 200  234 205  235 206  236 207  237 204  238 211  239 212
    240 63743  241 210  242 218  243 219  244 217  245 305  246 710
    247 732  248 175  249 728  250 729  251 730  252 184  253 733
    254 731  255 711
]