From: tarko@lanparty.ee (Tarko Tikan)
Subject: [sup-talk] display_length issue with special-characters on non-UTF8 terminal
Date: Sat, 13 Jun 2009 14:13:06 +0300 [thread overview]
Message-ID: <1244891132-sup-2424@valgus> (raw)
In-Reply-To: <1244834230-sup-1200@entry>
> (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
next prev parent reply other threads:[~2009-06-13 11:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 10:00 Tarko Tikan
2009-06-12 19:18 ` William Morgan
2009-06-13 11:13 ` Tarko Tikan [this message]
2009-06-15 14:10 ` William Morgan
2009-06-17 16:04 ` William Morgan
2009-06-17 18:34 ` Nicolas Pouillard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244891132-sup-2424@valgus \
--to=tarko@lanparty.ee \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox