bytespider / jsOAuth

JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.
http://bytespider.github.com/jsOAuth/
MIT License
556 stars 108 forks source link

umlaut handling #7

Closed ghost closed 13 years ago

ghost commented 13 years ago

Hey Rob, your code have problems in handling the german umlauts like ä,ö,ü and ß. Twitter responses with Incorrect signature to a status update containing ä, ö, ü or ß.

Regards jume

bytespider commented 13 years ago

Jume,

At the moment, the SHA1 part of the library only handles ASCII characters for certain. I thought I had addressed the UTF-8 requirement, but there could be a bug arround the stringToByteArray function https://github.com/bytespider/jsOAuth/blob/master/src/OAuth/Crypto.js#L147

Could you provide some test code, using the lastest version of jsOAuth?

Rob

ghost commented 13 years ago

Well, its just my regular post from the previous issue, but with a status containing ü. This error occurs in newest and also in 0.7.5.1

oauth.post("http://api.twitter.com/1/statuses/update.xml",{'status':"status with ü"},function(data) {console.log(data);},function (data) {console.log(data);});

I dont know much about UTF-8 and Byte decoding, so may i am not the right to help you here, but i can tell you the source code is written in UTF-8, if that could help you. I accidently closed this topic, maybe you could open it again. Regards jume

bytespider commented 13 years ago

Could you try this hotfix version in your app? My tests appear to work http://cl.ly/4P3h

ghost commented 13 years ago

y, works fine!