Skip to content

LocaleEditor does not work with some locale strings [SPR-8099] #12754

Closed
@spring-projects-issues

Description

@spring-projects-issues

David Mas opened SPR-8099 and commented

The org.springframework.beans.propertyeditors.LocaleEditor is not giving the expected locale for some input formats.

I have created a test case with all the possible calls to Locale constructor.
Then, for each combination call the LocaleEditor with locale.toString().
The expected behaviour of the LocaleEditor would be to return the same testLocale as it received testLocale.toString(), but it does not.

The problem is with the StringUtils parseLocale method.

Attached the test case and a fix.
On the fix, the separator can be both a space and a underscore because the LocaleEditor states "Also accepts spaces as separators, as alternative to underscores"


Affects: 3.0.5

Attachments:

Issue Links:

1 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions