utf8.c: Avoid unnecessary UTF-8 conversions
authorKarl Williamson <public@khwilliamson.com>
Fri, 29 Mar 2013 20:56:16 +0000 (14:56 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 29 Aug 2013 15:56:04 +0000 (09:56 -0600)
commit08fb1ac5e6aef1e5521f83d7ddf830d92ac82cd9
tree91ad79ac39fe5b69e196d9076841f8057f0c4377
parent3d0f8846febc7f75124837422e1b33df546a714d
utf8.c: Avoid unnecessary UTF-8 conversions

This changes the code so that converting to UTF-8 is avoided unless
necessary.  For such inputs, the conversion back from UTF-8 is also
avoided.  The cost of doing this is that the first swatches are combined
into one that contains the values for all characters 0-255, instead of
having multiple swatches.  That means when first calculating the swatch
it calculates all 256, instead of 128 (160 on EBCDIC).

This also fixes an EBCDIC bug in which characters in this range were
being translated twice.
utf8.c