Could you verify this, Oh Great Unicode Experts of the Python-List?

Joshua Landau joshua at landau.ws
Tue Aug 13 04:40:11 EDT 2013


On 11 August 2013 12:14, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Sun, 11 Aug 2013 10:44:40 +0100, Joshua Landau wrote:
>>>> "café" will be in your Copy-Paste buffer, and you can paste it in to
>>>> the tweet-box. It takes 5 characters. So much for testing ;).
>>>
>>> How do you know that it takes 5 characters? Is that some Javascript
>>> widget? I'd blame buggy Javascript before Twitter.
>>
>> I go to twitter.com, log in and press that odd blue compose button in
>> the top-right. After pasting at says I have 135 (down from 140)
>> characters left.
>
> I'm pretty sure that will be a piece of Javascript running in your
> browser that reports the number of characters in the text box. So, I
> would expect that either:
>
> - Javascript doesn't provide a way to normalize text;
>
> - Twitter's Javascript developer(s) don't know how to normalize text, or
> can't be bothered to follow company policy (shame on them);
>
> - the Javascript just asks the browser, and the browser doesn't know how
> to count characters the Twitter way;
>
> etc. But of course posting to Twitter via your browser isn't the only way
> to post. Twitter provide an API to twit, and *that* is the ultimate test
> of whether Twitter's dev guide is lying or not.

Well, I've done some further testing and it seems you're right. It's
just the javascript that's wrong. I guess they did it for better
load-times.



More information about the Python-list mailing list