Closed
Bug 1509849
Opened 7 years ago
Closed 7 years ago
Creating a Locale from an empty string should result in non-wellformed Locale
Categories
(Core :: Internationalization, enhancement)
Core
Internationalization
Tracking
()
RESOLVED
FIXED
mozilla65
| Tracking | Status | |
|---|---|---|
| firefox65 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
Attachments
(2 files)
|
886 bytes,
patch
|
zbraniecki
:
review+
|
Details | Diff | Splinter Review |
|
854 bytes,
patch
|
zbraniecki
:
review+
|
Details | Diff | Splinter Review |
Currently, trying to construct a Locale from an empty string will raise an assertion (in debug builds), but then leave the resulting object empty but still marked as well-formed, AFAICS.
I think it would be more logical to simply treat an empty string as not-well-formed, like we do for any string that contains non-ASCII characters.
(I happened to hit this assertion in bug 1503157; I fixed it for now by explicitly checking for an empty lang string before trying to create a Locale, but I think it'd make more sense to just let the Locale be created as non-well-formed, rather than requiring the caller to check for non-empty ahead of time.)
| Assignee | ||
Comment 1•7 years ago
|
||
:zibi, does this seem logical to you, or is there some reason we can't simply treat an empty string this way?
Attachment #9027523 -
Flags: review?(gandalf)
| Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•7 years ago
|
||
Assuming we do the above, we can then revert the followup I pushed in bug 1503157 when it turned out to hit the empty-string assertion.
Attachment #9027524 -
Flags: review?(gandalf)
Comment 3•7 years ago
|
||
Comment on attachment 9027523 [details] [diff] [review]
Treat an empty string as non-wellformed when creating Locale, but don't throw an assertion
Review of attachment 9027523 [details] [diff] [review]:
-----------------------------------------------------------------
ahh, yeah! thanks Jonathan!
Attachment #9027523 -
Flags: review?(gandalf) → review+
Updated•7 years ago
|
Attachment #9027524 -
Flags: review?(gandalf) → review+
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e8eaf7539ccb
Treat an empty string as non-wellformed when creating Locale, but don't throw an assertion. r=gandalf
https://hg.mozilla.org/integration/mozilla-inbound/rev/2fdce5544015
Revert the followup from bug 1503157 now that an empty locale string is handled properly by the Locale constructor. r=gandalf
Comment 5•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e8eaf7539ccb
https://hg.mozilla.org/mozilla-central/rev/2fdce5544015
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in
before you can comment on or make changes to this bug.
Description
•