views:

951

answers:

1

I'm having trouble sharing messages containing scandinavian ä & ö to twitter through a share-button on my site. If I use UTF8-codes above %7F, i just bump into an "Invalid Unicode value in one or more parameters" error.

An example: http://twitter.com/home/?status=%40user+blah%26%E4

I've tried a bunch of different encodings, but none seem to work with ä, ö etc.

Anyone found a solution for this?

Edit: Part of this problem is related to what address you link your share-tweet. Links to http://twitter.com/home/?status=%40user+blah%26%E4%C3%A4 and http://www.twitter.com/home/?status=%40user+blah%26%E4%C3%A4 Yield very different results.

+1  A: 

UTF-8 represents code points above U+007F using more than one byte. So when you want ä (U+00E4), the UTF-8 representation is the two bytes C3 A4 and thus the percent-encoding is %C3%A4. A handy website that will help you with these conversions is http://www.hypergurl.com/urlencode.html

Jon Reid
Thanks! Weirdly, I though i'd tried this, but apparently hadn't.
Marcus