* * * * * Code and Data, Theory and Practice > From: Steve Crane > To: Sean Conner > Subject: @siwisdom twitter feed > Date: Sat, 1 Jan 2011 15:46:14 +0200 > > Hi Sean, > > Are you aware that the quotation marks in the @siwisdom > tweets display as “ and ” in > clients like TweetDeck? Perhaps you should switch to using regular ASCII > (American Standard Code for Information Interchange) double quotes. > > Regards and Happy New Year. > Yes, I'm aware. They show up on the main Twitter page [2] as well, and there isn't much I can do about it, other than sticking exclusively with ASCII and forgoing the nice typographic characters. It appears to be related to this rabbit hole [3], only in a way that's completely different. What's going on here is explained here: > We have to encode HTML (HyperText Markup Langauge) entities to prevent XSS > (Cross Site Scripting) attacks. Sorry about the lost characters. > “counting messages: characters vs. bytes, HTML entities - Twitter Development Talk | Google Groups [4]” And XSS (Cross Site Scripting) [5] has nothing to do with attacking one website from another, but everything to do with the proliferation of character encoding schemes and the desire to fling bits of executable code (aka (also known as) ``Javascript'') along with our bits of non-exectuable data (aka ``HTML''). The problem is keeping the bits of executable code (aka ``Javascript'') from showing up where it isn't expected. But in the case of Twitter, I don't think they actually understand how their own stack works. Or they just took the easy way out and any of the ``special'' characters in HTML, like ``&'', ``<'' and ``>'' are automatically converted to their HTML entity equivelents ``&'', ``<'' and ``>''. Otherwise, to sanitize the input, they would need to do the following: 1. get the raw input from the HTML form 2. convert the input from the transport encoding (usually URL encoding [6] but it could be something else, depending upon the form) 3. possibly convert the string into a workable character set the program understands (say, the browser sent the character data in WINDOWS-1251, because Microsoft is like that, to something a bit easier to work with, say, UTF-8) 4. if HTML is allowed, sanitize the HTML by 4. 1. removing unsupported or dangerous tags, like