neharob / hotot

Automatically exported from code.google.com/p/hotot
0 stars 0 forks source link

非英文环境下无法正确显示推 #351

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.保证相关语言包已安装
2.以非英文环境启动hotot,如 LANG=zh_CN.UTF8 hotot
3.登录

What is the expected output? What do you see instead?
启用了verbose模式后,终端中输出
[Req] 
{"type":"GET","url":"https://api.twitter.com/1/statuses/home_timeline.json?XXXXX
XXX","data":{}}
** Message: console message: undefined @0: URIError: URI error

[Req] 
{"type":"GET","url":"https://api.twitter.com/1/statuses/mentions.json?XXXXXXXX",
"data":{}}
** Message: console message: undefined @0: URIError: URI error

[Req] 
{"type":"GET","url":"https://api.twitter.com/1/direct_messages.json?XXXXXXXX","d
ata":{}}
** Message: console message: undefined @0: URIError: URI error
同时列表里一片空白,一直显示加载中的图像

What version of the product are you using? On what operating system and
what Desktop Environment?
hotot 1:0.9.6~hg775-0ubuntu0ppa1~natty1
libwebkitgtk-1.0-0 1.3.13-0ubuntu2

Please provide any additional information below.
经过调试发现是ui.template.js中的几个form_XXX函数中以下两句引�
��的
decodeURIComponent(escape(create_at.toLocaleTimeString()))
decodeURIComponent(escape(create_at.toLocaleDateString()))

在中文环境中,toLocaleTimeString()和toLocaleDateString()会返回类似�
��如下的结果
11时11分11秒
2011年11月11日
而
decodeURIComponent(escape("11时11分11秒"))
decodeURIComponent(escape("2011年11月11日"))
都会抛出URI错误的异常

我没有读过twitter的文档,不知道为什么要先escape后再decodeURIC
omponent。我修改了下代码,去掉了escape和decodeURIComponent,在zh_
CN.UTF8和en_US.UTF8下都可以正常显示

Original issue reported on code.google.com by xnrefor...@gmail.com on 24 Apr 2011 at 1:19

GoogleCodeExporter commented 9 years ago
This's a workaround for a bug of webkitgtk. it seems to have been fix.
FYI: revision febfd2d7983a

Original comment by 5h3l...@gmail.com on 25 Apr 2011 at 9:54

GoogleCodeExporter commented 9 years ago
Issue 306 has been merged into this issue.

Original comment by 5h3l...@gmail.com on 26 Apr 2011 at 5:32

GoogleCodeExporter commented 9 years ago

Original comment by 5h3l...@gmail.com on 31 May 2011 at 1:22