Bug 44668 - [Gtk] Date.toLocaleTimeString() return a unexpected localize string
Summary: [Gtk] Date.toLocaleTimeString() return a unexpected localize string
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 00:13 PDT by Shellex Wai
Modified: 2017-03-11 10:57 PST (History)
4 users (show)

See Also:


Attachments
Screenshot. (deleted)
2010-08-26 00:14 PDT, Shellex Wai
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shellex Wai 2010-08-26 00:13:55 PDT
I think it's a bug of webkit(or webkit-gtk, i am not sure).

Date.toLocalTimeString() return a unexpected localize string.

= What steps will reproduce the problem? =
== way 1 ==
 - open a webkit-gtk based browser
 - paste `javascript:alert(new Date().toLocaleTimeString())` to address entry.
 - type enter.

== way 2 ==
 - open terminal
 - paste `LANG="zh_CN.UTF-8" python -c "import webkit; webkit.WebView().execute_script('alert (new Date().toLocaleTimeString())');"`
 - type enter

= What is the expected output? What do you see instead? =

 - In Firefox for Linux, it return "HH时MM分SS秒" in locale "zh_CN.UTF-8"

 - In Google Chrome for Linux, it return "HH:MM:SS" in locale "zh_CN.UTF-8"

 - In Webkit-gtk base browser, it return something like "15æ¶12å12ç§" ... see attachment for detail.

I think the firefox-way is better.

It seems webkit-gtk wanna deal it in firefox-way, but what it dose is not good enough.
Comment 1 Shellex Wai 2010-08-26 00:14:55 PDT
Created attachment 65531 [details]
Screenshot.
Comment 2 Xan Lopez 2010-08-27 01:52:20 PDT
This works for me with epiphany master and latest WebKitGTK+ from trunk. What version are you using?
Comment 3 Shellex Wai 2010-08-28 05:13:49 PDT
(In reply to comment #2)
> This works for me with epiphany master and latest WebKitGTK+ from trunk. What version are you using?

in locale zh_CN.UTF-8 ?
my webkit version: 

$ dpkg -s libwebkit-1.0-2
Package: libwebkit-1.0-2
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 14828
Maintainer: Debian WebKit Maintainers <pkg-webkit-maintainers@lists.alioth.debian.org>
Architecture: i386
Source: webkit
Version: 1.2.3-2
Comment 4 Shellex Wai 2010-10-02 04:54:31 PDT
workaround:
{{{
decodeURIComponent(escape(new Date().toLocaleTimeString()))
}}}

via:
http://code.google.com/p/hotot/source/detail?r=b573c8cf8ecb0c3f7ee0319ea412f59bf14df50e
Comment 5 Martin Robinson 2010-10-04 08:30:51 PDT
I could not reproduce this issue with a fairly recent build of WebKit GTK+, do you mind trying it on a later, unstable version?