Closed Bug 349488 Opened 18 years ago Closed 18 years ago

num_toLocaleString does not convert from locale encoding to Unicode

Categories

(Core :: JavaScript Engine, defect)

1.0 Branch
x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: pascalc, Assigned: smontagu)

Details

(Keywords: fixed1.8.1, Whiteboard: [181approval pending])

Attachments

(2 files)

1 Display an image in a window like http://www.mozilla.com/images/firefox-logo-64x64.png

2 Open the page info dialog

Expected result : file size in bytes is 8 118
Actual result : file size in bytes is displayed 8Â 118

This bug can be seen with both Firefox 1.5.0.5 (Ubuntu Distro version) and 2.0b1 builds. 

It is not related to localisation since I can see the bug with an en-US version as well.

The bug does not show up on Windows, it was confirmed by 2 more people using Gnome/Ubuntu (don't know about KDE users).
Here is a screenshot demonstrating the bug
This seems likely to be a problem with the linux implementation of toLocaleString (the page info dialog passes the number through that function before displaying it). Does |javascript:(1024).toLocaleString()| in the location bar give you the same strange result?
javascript:(1024).toLocaleString() does indeed produce the same error in Linux and not in Windows
Assignee: nobody → general
Component: Page Info → JavaScript Engine
Product: Firefox → Core
QA Contact: page.info → general
Summary: page info file size in bytes shows a parasite letter on Linux → toLocaleString produces strange output on Linux (page info file size in bytes shows a parasite letter)
Version: unspecified → 1.8 Branch
Pascal: could you provide the output of:
cat /usr/share/i18n/locales/<locale> | grep "thousands"
on the system that shows the bug, where <locale> is the configured system locale?
heren are the results :

cat /usr/share/i18n/locales/fr_FR | grep "thousands"

mon_thousands_sep         "<U00A0>"
thousands_sep             "<U00A0>"


Component: JavaScript Engine → Build Config
Product: Core → Firefox
Version: 1.8 Branch → 1.0 Branch
Component: Build Config → Error Console
Product: Firefox → Core
What the screenshot shows is 0xC2 0xA0, which is U+00A0 in UTF-8, displayed as if it were ISO-8859-1
Summary: toLocaleString produces strange output on Linux (page info file size in bytes shows a parasite letter) → num_toLocaleString does not convert from locale encoding to Unicode
Component: Error Console → JavaScript Engine
Assignee: general → smontagu
Status: NEW → ASSIGNED
Attachment #234836 - Flags: review?
Attachment #234836 - Flags: review? → review?(brendan)
Comment on attachment 234836 [details] [diff] [review]
Convert to Unicode

Wow, how'd that get left out?  Does the implementation of that hook work correctly in this case?  Thanks,

/be
Attachment #234836 - Flags: review?(brendan)
Attachment #234836 - Flags: review+
Attachment #234836 - Flags: approval1.8.1?
The cases mentioned here work in fr_FR locale, but I would like to test it with something a bit more "solid" than a no-break-space if I can find an appropriate locale.
There are no locales on my system that use any non-ASCII code points for thousands separator or decimal separator other than U+00A0, but I tested by hacking various values into the LC_NUMERIC file, and they all displayed correctly. 
Whiteboard: [181approval pending]
Flags: blocking1.8.1?
Fix checked into trunk.

/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment on attachment 234836 [details] [diff] [review]
Convert to Unicode

a=schrep for drivers - approving all [181approval pending] bugs now that the tree is open.
Attachment #234836 - Flags: approval1.8.1? → approval1.8.1+
Flags: blocking1.8.1? → blocking1.8.1+
Flags: in-testsuite-
I committed Simon's patch to the 1.8 branch.

/be
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: