Closed
Bug 943283
Opened 11 years ago
Closed 7 years ago
Locale-specific JS number/date formatting should not make a trip through non-UTF encodings
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: hsivonen, Assigned: m_kato)
References
Details
Attachments
(1 file)
XPCLocale.cpp assumes that locale-specific number/date formatting may go through a locale-dependent non-UTF encoding. This makes no sense in 2013 and gets in the way of removing nsIPlatformCharseet. Locale-specific number/date formatting should be possible using Unicode APIs only--possibly ICU.
Comment 1•11 years ago
|
||
We need to rewrite PRMJ_FormatTime so that it doesn't depend on CRT strftime which will return non-UTF-8 string on Windows, even in 2013.
Comment 2•11 years ago
|
||
An easiest solution would be using wcsftime on WIndows.
Reporter | ||
Comment 3•9 years ago
|
||
It seems that the right way to fix this in to fix bug 866344 and then remove the resulting dead code.
Depends on: 866344
Assignee | ||
Comment 4•7 years ago
|
||
After landing bug 1346674 and bug 1349470, we don't use NS_ILOCALE_DATE. So we can replace it with NS_CopyNativeToUnicode simply.
Comment hidden (mozreview-request) |
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8851938 [details] Bug 943283 - Use NS_CopyNativeToUnicode instead of nsIUnicodeDecoder. https://reviewboard.mozilla.org/r/124192/#review126732 So according to the header (nsNativeCharsetUtils.h), NS_CopyNativeToUnicode "should only be used for converting *FILENAMES*...". However, in practice I think it's fine here, given the very limited scope where it's used.
Attachment #8851938 -
Flags: review?(jfkthame) → review+
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/35caf320cf70 Use NS_CopyNativeToUnicode instead of nsIUnicodeDecoder. r=jfkthame
Comment 8•7 years ago
|
||
sorry had to back this out for build bustage like https://treeherder.mozilla.org/logviewer.html#?job_id=87140618&repo=autoland&lineNumber=14358 https://hg.mozilla.org/integration/autoland/rev/a9d7ba18975f
Flags: needinfo?(m_kato)
Comment 10•7 years ago
|
||
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/mozilla-inbound/rev/8c24ffa3f69e Use NS_CopyNativeToUnicode instead of nsIUnicodeDecoder. r=jfkthame
Comment 11•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8c24ffa3f69e
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•