jgoerzen / twidge

Command-line twitter/identica client [Haskell]
http://wiki.github.com/jgoerzen/twidge/
GNU General Public License v2.0
220 stars 30 forks source link

twidge: <stdout>: commitAndReleaseBuffer: invalid argument (Invalid or incomplete multibyte or wide character) #29

Closed erviker closed 13 years ago

erviker commented 13 years ago

if these characters øæå is in post i get this error they are use in the Scandinavian languages

twidge: : commitAndReleaseBuffer: invalid argument (Invalid or incomplete multibyte or wide character)

erviker commented 13 years ago

sorry the bug was in my system not your code

jgoerzen commented 13 years ago

What version are you running?

On 03/28/2011 08:22 PM, erviker wrote:

if these characters øæå is in post i get this error they are use in the Scandinavian languages

twidge: : commitAndReleaseBuffer: invalid argument (Invalid or incomplete multibyte or wide character)

erviker commented 13 years ago

1.0.6

jgoerzen commented 13 years ago

Ah ok, just now saw the comment that the bug was in your system. I'll go ahead and close it -- thanks. I'm curious what the bug was, in case other people run into this.

doct commented 13 years ago

Thanks for providing this great tool and looking into the issues!

I can confirm the issue with "other languages' characters": happens also with ó from Spanish or ü from German.

The error messages are the same, and the output of e.g. lsrecent stops right there.

This happens on debian 6 stable (aka squeeze) with twidge 1.0.6.

The issue does NOT appear on debian 6 testing (aka wheezy) as of May 4th 2011 using twidge 1.0.8.

twidge in both cases was installed from the debian repository and all dependencies pulled in automagically by apt-get.

jgoerzen commented 13 years ago

What is the value of $LANG?

doct commented 13 years ago

A-haaa!

C on squeeze, en_US.UTF-8 on wheezy.

Setting LANG=en_US.UTF-8 on squeeze/twidge 1.0.6 results in correct output.

Setting LANG=C on wheezy/twidge 1.0.8 breaks the output now, too!

Hence, the workaround (or, correct shell configuration) is to set LANG to en_US.UTF-8

In addition, I suggest to change the twidge code to "fail gracefully" in case of unprintable characters :-)

Thanks for your support!

DrDub commented 12 years ago

In case somebody bump into the same problem, I had LANG set correctly to en_US.UTF-8 but I didn't have that locale generated in that virtual machine. Annoying and confusing.

Again, great program, thanks for the great work!