Skip to content

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

Closed

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

Activity

  1. added
    type: bug
    status: duplicate
    in: web
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webstatus: duplicate

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions