Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rjbs (4671)

rjbs
  (email not shown publicly)
http://rjbs.manxome.org/
AOL IM: RicardoJBSignes (Add Buddy, Send Message)
Yahoo! ID: RicardoSignes (Add User, Send Message)

I'm a Perl coder living in Bethlehem, PA and working Philadelphia. I'm a philosopher and theologan by training, but I was shocked to learn upon my graduation that these skills don't have many associated careers. Now I write code.

Journal of rjbs (4671)

Saturday April 12, 2008
06:30 PM

addex, mutt, and ascii

[ #36137 ]

After my last set of poking at making Addex do 7-bitization of funny characters, I did some more poking around and learned some things that helped me get everything working just fine. I've made a new release of Addex and the Apple address book plugin, so now anyone can have his friend José show up with an alias of jose by updating his Addex config to include:

[App::Addex::Output::Mutt]
unidecode = 1

This replaced my lousy unicode-to-ascii conversion with Sean M. Burke's presumably awesome Text::Unidecode. It catches every case I caught, and probably a lot more that I haven't had to worry about yet. I saw the tests spitting bizarre southeast Asian characters to the screen and was glad I never had to think about it.

I also found out that the simple rule with Mac::Glue is that you either get back Unicode or MacRoman. From looking at the source, I think the Unicode will always be in a string that is_utf8, so I just decode any non-is_utf8 string from MacRoman.

Having done that, without using Text::Unidecode, mutt was still confused. Then I realized that it was all my fault: I was not setting the write filehandle to utf8 mode, so the bytes were getting mangled. Once I did that, the file made a lot more sense. Of course, it still meant that I would have to type in funny characters if they were in the "before I hit tab to tab complete" part of a name, so I still wanted to downgrade to the English alphabet. Text::Unidecode quietly replaced my code, and then I added a config option and it's done. Anyone using Addex with contacts who have silly foreign names should update. My mutt is a lot nicer to look at now.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.