Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

special characters with Net::Twitter::Lite

I try to send characters like ü, ä, ß, à and so on to twitter. If I use unicode characters in my scripts they come out wrong in twitter. If I use HTML (which is possible in twitter's web-interface and which used to work previously) I see now ü rather than "ü" in the post. Is there a parameter or something that I have to set? Some call to encode/decode? I am using:

use Net::Twitter::Lite::WithAPIv1_1;

like image 869
Stefan Müller Avatar asked Aug 07 '13 10:08

Stefan Müller


Video Answer


1 Answers

I find myself checking out the test suite of perl modules quite often as it is a good source for examples.

Net::Twitter expects decoded characters, not encoded bytes So, sending encoded utf8 to Net::Twitter will result in double encoded data.

Source: https://metacpan.org/source/MMIMS/Net-Twitter-Lite-0.12006/t/unicode.t

like image 70
davewood Avatar answered Nov 15 '22 10:11

davewood