Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Unicode
@ 2007-07-25 15:34 Dan Sully
  2007-07-25 17:42 ` William Morgan
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Sully @ 2007-07-25 15:34 UTC (permalink / raw)


I know Unicode support in Ruby is.. lacking. But is there anything I can do to
prevent the dreaded unicode question marks (often followed by a tilde), which
totally destroy the curses layout. 

I see that iconv is being used in sup, but I'm not sure when/why.

Thanks.

-D
--
<dsully> please describe web 2.0 to me in 2 sentences or less.
<jwb> you make all the content. they keep all the revenue.

-- 

-D
--
<dsully> please describe web 2.0 to me in 2 sentences or less.
<jwb> you make all the content. they keep all the revenue.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [sup-talk] Unicode
  2007-07-25 15:34 [sup-talk] Unicode Dan Sully
@ 2007-07-25 17:42 ` William Morgan
  2007-07-25 17:54   ` Dan Sully
  0 siblings, 1 reply; 5+ messages in thread
From: William Morgan @ 2007-07-25 17:42 UTC (permalink / raw)


Excerpts from Dan Sully's message of Wed Jul 25 08:34:29 -0700 2007:
> I know Unicode support in Ruby is.. lacking. But is there anything I
> can do to prevent the dreaded unicode question marks (often followed
> by a tilde), which totally destroy the curses layout. 

Here's what has worked for me:

1. Use gnome-terminal
2. set LANG=en_US.UTF-8

Then, somehow, magically, using ncurses to display utf8 characters just
works. Well, I haven't tried wide characters, but accented characters
work.

> I see that iconv is being used in sup, but I'm not sure when/why.

Sup uses iconv to convert messages (and individual headers) marked as
in specific encodings to your local encoding, as determined by LC_CTYPE
and LANG environment variables.

What *doesn't* work right now is calculating the lengths of unicode
strings, so the display is a little screwed up for characters that take
more than one utf-8 byte. But still usable.

-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [sup-talk] Unicode
  2007-07-25 17:42 ` William Morgan
@ 2007-07-25 17:54   ` Dan Sully
  2007-07-25 18:50     ` William Morgan
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Sully @ 2007-07-25 17:54 UTC (permalink / raw)


> Here's what has worked for me:
> 
> 1. Use gnome-terminal
> 2. set LANG=en_US.UTF-8

I'm using LANG, but with xterm-color (via Terminal.app to a Ubuntu box). That
setup works fine for Mutt, fyi.

I'll wait for another full wide subject line to come in, but the other ones
have been Windows encoded quotes and the like.
 
> What *doesn't* work right now is calculating the lengths of unicode
> strings, so the display is a little screwed up for characters that take
> more than one utf-8 byte. But still usable.

Ok, that would make sense.

-- 

-D
--
<dsully> please describe web 2.0 to me in 2 sentences or less.
<jwb> you make all the content. they keep all the revenue.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [sup-talk] Unicode
  2007-07-25 17:54   ` Dan Sully
@ 2007-07-25 18:50     ` William Morgan
  2007-07-25 19:00       ` Dan Sully
  0 siblings, 1 reply; 5+ messages in thread
From: William Morgan @ 2007-07-25 18:50 UTC (permalink / raw)


Excerpts from Dan Sully's message of Wed Jul 25 10:54:23 -0700 2007:
> I'm using LANG, but with xterm-color (via Terminal.app to a Ubuntu
> box). That setup works fine for Mutt, fyi.

If you cat out a utf-8 file, does the terminal display the right thing?
If so, I would think that would work for Sup... at least under my
current mental model where ncurses doesn't do anything except put out
raw bytes which the terminal interprets.

> > What *doesn't* work right now is calculating the lengths of unicode
> > strings, so the display is a little screwed up for characters that
> > take more than one utf-8 byte. But still usable.
> 
> Ok, that would make sense.

And in fact it's actually only a problem in thread-index-mode when
someone's name is a rfc2047-encoded header. In every other case there's
no character alignment issue. :)


-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [sup-talk] Unicode
  2007-07-25 18:50     ` William Morgan
@ 2007-07-25 19:00       ` Dan Sully
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Sully @ 2007-07-25 19:00 UTC (permalink / raw)


> If you cat out a utf-8 file, does the terminal display the right thing?
> If so, I would think that would work for Sup... at least under my
> current mental model where ncurses doesn't do anything except put out
> raw bytes which the terminal interprets.

Yep, it displays the right thing. I'll try and get you more data.

-- 

-D
--
<dsully> please describe web 2.0 to me in 2 sentences or less.
<jwb> you make all the content. they keep all the revenue.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-25 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-25 15:34 [sup-talk] Unicode Dan Sully
2007-07-25 17:42 ` William Morgan
2007-07-25 17:54   ` Dan Sully
2007-07-25 18:50     ` William Morgan
2007-07-25 19:00       ` Dan Sully

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox