[DRE-maint] Bug#705799: lolcat: chokes upon invalid utf-u

chrysn chrysn at fsfe.org
Sat Apr 20 21:25:06 UTC 2013


owner 705799 !
tags + moreinfo
thanks

hello sebastian,

i don't think this constitutes a bug -- lolcat by design inserts control
sequences, so it has to work on characters instead of bytes, and if your
locale states that the current character encoding is utf8 and your data
is not utf8, there's nothing lolcat can reasonably do. (if it operated
on byte data, it would risk inserting control sequences inside
multi-byte encoded data.)

lolcat even adapts to the environment -- while this works:

$ echo 'Scheiß Encoding' | recode html..utf8 | LANG=C.UTF-8 lolcat

this does not, as one would expect:

$ echo 'Scheiß Encoding' | recode html..utf8 | LANG=C lolcat
/usr/lib/ruby/vendor_ruby/lolcat/lol.rb:45:in `gsub!': invalid byte sequence in US-ASCII (ArgumentError)


can you demonstrate a behavior where it can be argued that the input is
valid and lolcat still errs out? so far, i'd say that "invalid byte
sequence" is a valid reaction to invalid input data.

best regards
chrysn

-- 
lolcat has seen more bug reports than popcon submissions, should I be
worried?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20130420/ad03a174/attachment.pgp>


More information about the Pkg-ruby-extras-maintainers mailing list