This is not documented anywhere that I can find, the recent changes (https://dev.twitter.com/ads/overview/recent-changes) do not mention a change. There is no mention beyond UTF-8 encoding against the documentation either ([https://dev.twitter.com/overview/api/tweets] (https://dev.twitter.com/overview/api/tweets)), which actually says
text contains the “actual text”. Using the API tool to do some testing (https://dev.twitter.com/rest/tools/console) shows the text in the response as not HTML encoded, but this is incorrect, the HTTP response to the tool looks to be encoded. but the tool does not represent that in the JSON object. The actual response coming back from the API using another tool definitely shows the HTTP response as encoded, i.e.
text=<script>alert("here be dragons");</script>.
I’d like to resolve the problem, but without documentation I am not certain we can literally just decode the resulting text to get the correct text for the tweet. Is it possible to get the raw text by passing an undocumented flag? If not then what is the expected process to get the actual text of the tweet that has not been processed into display on HTML?