Twitter tweets error due to [] characters from macOS application

Twitter displays an error message for all tweets that have these characters [ ] . The error is given below;

  HTTP Status 401: Unauthorized, Response: {"errors": [{"code":32,"message":"Could not authenticate you."}]} 

I was developing a Twitter client on macOS , recently realized that if I put [ or ] in the contents of a tweet, the tweet will not get tweeted. Twitter simply sends back the error message above.

I use macOS Sierra , I encountered the same problem in El Capitan , as well as in Yosemite , but I could not reproduce the problem in both iOS and Android Twitter clients that I created. It works fine on iOS and Android .

I am sure that before clearing the contents, I do not do any string encodings. I send the standard String value to the system default JSONSerialisation method, which takes care of converting it to the appropriate Data format with any of the following encodings UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE .

You guys ran into such a problem on macOS, thanks in advance!

+5
source share

Source: https://habr.com/ru/post/1262069/


All Articles