Twitter Streaming API使用的官方编码?是UTF-8吗? [英] Official encoding used by Twitter Streaming API? Is it UTF-8?
问题描述
我看到的Twitter网站的唯一部分在这里他们甚至暗示他们使用的是他们的官方编码:
Twitter不想因为我们使用的事实而处罚用户UTF-8或因为有问题的API客户端使用较长的代表性的事实
https://dev.twitter.com/docs/counting-characters
谢谢! :D
一个指标是 JSON格式,Twitter用于几乎所有内容,指定(或至少默认为)UTF-8。他们应该还设置一个适当的HTTP标头,表示编码(但我还没有确认这个)。如果您使用的是XML,则XML开始标签显式表示编码,即UTF-8。
What is the official encoding for Twitter's streaming API? My best guess is UTF-8 based on what I've seen, but I would like to avoid making assumptions.
The only part of the Twitter site I've seen where they even hint at what they use as their official encoding is here:
Twitter does not want to penalize a user for the fact we use UTF-8 or for the fact that the API client in question used the longer representation
Does anyone have a more "official" answer? I'm writing a state-machine tokenizer for the streaming API which makes certain assumptions. The last thing I want is to encounter something like UTF-16.
Thanks! :D
One indicator is that the JSON format, which Twitter uses for virtually everything, dictates (or at least defaults to) UTF-8. They should also set an appropriate HTTP header denoting the encoding (but I haven't confirmed this). If you're using XML instead, the XML opening tag explicitly denotes the encoding, which is UTF-8.
这篇关于Twitter Streaming API使用的官方编码?是UTF-8吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!