Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] display_length issue with special-characters on non-UTF8 terminal
Date: Mon, 15 Jun 2009 07:10:30 -0700	[thread overview]
Message-ID: <1245074739-sup-3954@entry> (raw)
In-Reply-To: <1244891132-sup-2424@valgus>

Reformatted excerpts from Tarko Tikan's message of 2009-06-13:
> 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.

It's hackish because Ruby 1.8 has shitty multibyte support. The only
reason it works at all is because byte length is character length (at
least most of the time) in your encoding.

There is a multibyte gem out there that I'm keeping an eye on. Also Ruby
1.9.1 allegedgly fixes this problem.

> 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?) 

Size and length are synonmys for both arrays and strings. I used size
there for symmetry.
-- 
William <wmorgan-sup at masanjin.net>


  reply	other threads:[~2009-06-15 14:10 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
2009-06-15 14:10     ` William Morgan [this message]
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=1245074739-sup-3954@entry \
    --to=wmorgan-sup@masanjin.net \
    /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