Closed
Bug 1228755
Opened 9 years ago
Closed 9 years ago
ASSERTION: language code too short: '(len == 2) || (len == 3)', file intl/locale/unix/nsPosixLocale.cpp, line 126
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Unassigned)
References
Details
(Keywords: assertion)
Attachments
(1 file)
1.07 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
STEPS TO REPRODUCE 1. (export LANG="C.UTF-8"; firefox ) ACTUAL RESULTS ASSERTION: language code too short: '(len == 2) || (len == 3)', file intl/locale/unix/nsPosixLocale.cpp, line 126 BUILDS AND PLATFORMS TESTED Bug occurs in a DEBUG trunk build on Linux. FYI LANG="C.UTF-8" is the value Ubuntu gives me with System Settings -> Regional Settings -> Formats -> Region: Default (C)
Comment 1•9 years ago
|
||
nsPosixLocale::GetXPLocale already special-cases the "C" locale. We should probably add special-casing for "C.UTF-8" as well.
Comment 3•9 years ago
|
||
Comment on attachment 8693285 [details] [diff] [review] fix? Review of attachment 8693285 [details] [diff] [review]: ----------------------------------------------------------------- Yes, I think this is the way to go.
Attachment #8693285 -
Flags: review?(smontagu) → review+
Comment 5•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fcda0da2ed2a
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 6•9 years ago
|
||
I think this patch is wrong on two counts ( Bug 981463 - Allow one letter "C" as in C.UTF-8 as a valid language code 1. This patch does not seem to work, AND MORE GRAVELY 2. We should not change language code to en_US when the user specifically sets it to "C". I mean, instead of en-US.UTF-8we can assign "js_JP.UTF-8" or whatever, but that does not make sense. The user wanted to use "C" as defined in ISO-C or POSIX locale. So I think using en-US.UTF-8 is quite improper here. + if (strcmp(posixLocale,"C.UTF-8")==0) { + locale.AssignLiteral("en-US.UTF-8"); + return NS_OK; + } As for point 1, did the patch work for the original poster? Under what platform? On Debian GNU/Linux, it does not work. I prefer the approach in Bug 981463. TIA
Comment 7•9 years ago
|
||
A little more background can be found in Bug 960957
Comment 8•9 years ago
|
||
Actually comment https://bugzilla.mozilla.org/show_bug.cgi?id=960957#c20 in 960957 explains why the patch in 981463 was created the way it was written. TIA
You need to log in
before you can comment on or make changes to this bug.
Description
•