Special Characters with Net :: Twitter :: Lite

I am trying to send characters like ü, ä, ß, à etc. on twitter. If I use Unicode characters in my scripts, they appear incorrectly on Twitter. If I use HTML (which is possible in the twitter web interface and which previously worked), I now see & # 252; not "ü" in the message. Is there a parameter or something that I have to set? Some calls for encoding / decoding? I use:

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

+7
html perl unicode twitter
source share
2 answers

I find that I check the perl module set quite often, as it is a good source for examples.

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

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

+1
source share

Try

 use encoding 'utf8'; 

at the beginning of your script. sometimes this is the solution to many utf8 problems.

0
source share

All Articles