#651 closed defect (fixed)

HTTP Error 401 Unauthorized generated when I post a message with french characters

Reported by: didier@… Owned by: geert
Priority: major Milestone:
Component: Twitter Version: devel
Keywords: Cc:
IRC client+version: weechat 0.2.3 Operating System: Public server
OS version/distro:


I'm using the server with a twitter account. When I post messages with french characters (for example é or à), I got this error:

twitter - Error: HTTP error: 401 Unauthorized (Incorrect signature)

And my message is not posted.

Attachments (0)

Change History (4)

comment:1 Changed at 2010-07-28T23:29:10Z by wilmer

Hmm. Odd.

I found this one:

Odd thing is, I think you said this used to work? Maybe with an older BitlBee though, one that didn't use OAuth yet.

Anyway, I think BitlBee already encodes chars the way that document describes. Let's see..

comment:2 Changed at 2010-07-29T07:34:00Z by wilmer

Huh. It does work for me when I test it on my laptop, but indeed broke on my normal setup. Smells like charset configuration issues.

comment:3 Changed at 2010-07-29T07:49:56Z by wilmer

Priority: blockermajor

Ah, I think I found it.

This happens to me on my main machine since it has locale set to latin1. Apparently isalpha() returns 1 for more than just A-Za-z. The result is that only one of the two bytes of most Unicode sequences gets HTTP-encoded. OAuth is very sensitive to this, so there we have our failure. I'll fix it.

BTW, this is *absolutely* not a blocker bug, critical and blocker eather mean "feature *completely* unusable" or, preferably, "so insecure I would rather run old versions of Sendmail, BIND and a thousand PHP apps".

comment:4 Changed at 2010-07-29T09:02:36Z by wilmer

Resolution: fixed
Status: newclosed

Fixed by changeset:devel,628.

This problem started when setlocale() was added to unix.c. Note that this problem only happens (I think) on machines that have a non-UTF-8 charset set as their system default. People who are fully on UTF-8 (and not just internally in BitlBee) should not have this issue at all.

And with this revision, nobody will. :-) I'll run the deb updater now and also roll this out to

Modify Ticket

as closed The owner will remain geert.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.