I think you're not encoding this properly. You're sending one
character, so you should send just one code, not three. Sure, Twitter
should not break if you do this but, at the same time, your encoding
is not right.
Looking at your example, it seems you're converting your UTF-8 to a
string of bytes and sending each byte separately, which should not be
the case.
(I have the slight impression that it should be something like
"status=%4054" or some other very right value, but, again, just one
character, not three.)
--
Julio Biason <julio....@gmail.com>
Twitter: http://twitter.com/juliobiason
Correcting myself:
status=あ
http://www.danshort.com/HTMLentities/index.php?w=hirag
Also... what happens when you don't try to urlencode the text? (e.g.,
send it as UTF-8 anyway)
NO! The original poster is correct -- you encode the Unicode point as UTF-8,
then send the bytes. From RFC 3986:
When a new URI scheme defines a component that represents textual
data consisting of characters from the Universal Character Set [UCS],
the data should first be encoded as octets according to the UTF-8
character encoding [STD63]; then only those octets that do not
correspond to characters in the unreserved set should be percent-
encoded. For example, the character A would be represented as "A",
the character LATIN CAPITAL LETTER A WITH GRAVE would be represented
as "%C3%80", and the character KATAKANA LETTER A would be represented
as "%E3%82%A2".
--
------------------------------------ personal: http://www.cameronkaiser.com/ --
Cameron Kaiser * Floodgap Systems * www.floodgap.com * cka...@floodgap.com
-- He is rising from affluence to poverty. -- Mark Twain ----------------------
I was able to post this here:
http://twitter.com/guan/status/1525625497
The non-breaking space is right after the colon; try to save the HTML
and check in a hexdump ;-)
Normalized query string:
oauth_consumer_key=rNc2JuVC6NxELft2jXUQ&oauth_nonce=5614691C245EE261FB06ED7C1370974497&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1239806575&oauth_token=6631-AHu8rT9oznR3uUwHF7J99yU14s17D0vxR0OyKdRX54&oauth_version=1.0&status=a%20non-breaking%20space%3A%C2%A0wohoo
Signature base string:
POST&http%3A%2F%2Ftwitter.com%2Fstatuses%2Fupdate.json&oauth_consumer_key%3DrNc2JuVC6NxELft2jXUQ%26oauth_nonce%3D5614691C245EE261FB06ED7C1370974497%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1239806575%26oauth_token%3D6631-AHu8rT9oznR3uUwHF7J99yU14s17D0vxR0OyKdRX54%26oauth_version%3D1.0%26status%3Da%2520non-breaking%2520space%253A%25C2%25A0wohoo
Guan
I was able to post this here:
http://twitter.com/guan/status/1525625497
The non-breaking space is right after the colon; try to save the HTML
and check in a hexdump ;-)
Normalized query string:
oauth_consumer_key=rNc2JuVC6NxELft2jXUQ&oauth_nonce=5614691C245EE261FB06ED7C1370974497&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1239806575&oauth_token=6631-AHu8rT9oznR3uUwHF7J99yU14s17D0vxR0OyKdRX54&oauth_version=1.0&status=a%20non-breaking%20space%3A%C2%A0wohoo
Signature base string:
POST&http%3A%2F%2Ftwitter.com%2Fstatuses%2Fupdate.json&oauth_consumer_key%3DrNc2JuVC6NxELft2jXUQ%26oauth_nonce%3D5614691C245EE261FB06ED7C1370974497%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1239806575%26oauth_token%3D6631-AHu8rT9oznR3uUwHF7J99yU14s17D0vxR0OyKdRX54%26oauth_version%3D1.0%26status%3Da%2520non-breaking%2520space%253A%25C2%25A0wohoo
Guan
Thanks Guan - perhaps it's an issue with the signature base string not being encoded correctly at my end... let me dig into Net::OAuth a little more and see what I find.