From mboxrd@z Thu Jan 1 00:00:00 1970 From: tarko@lanparty.ee (Tarko Tikan) Date: Sat, 13 Jun 2009 14:13:06 +0300 Subject: [sup-talk] display_length issue with special-characters on non-UTF8 terminal In-Reply-To: <1244834230-sup-1200@entry> References: <1244536704-sup-7027@valgus> <1244834230-sup-1200@entry> Message-ID: <1244891132-sup-2424@valgus> > (I'm assuming that your terminal encoding is not UTF-8.) No, it's not. > Does this patch fix the issue? If so, I will release an 0.8.1. Yes it does. To me, this approach felt "hackish" so I didn't come up with a patch :) But I still don't have better idea how to fix it so it'll have to stay like this. > + if $encoding == "UTF-8" > + scan(/./u).size > + else > + size > + end It would probably be correct to use: if $encoding == "UTF-8" scan(/./u).size else length end Thats because scan returns a array (hence using the size), without scan you are just invoking on string and it's correct to use length (for some reason size works too, backward compatibility?) -- tarko