Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GWT 'String' toLowerCase and toUpperCase emulation #9540

Closed
srkprasadam opened this issue Aug 8, 2017 · 4 comments
Closed

GWT 'String' toLowerCase and toUpperCase emulation #9540

srkprasadam opened this issue Aug 8, 2017 · 4 comments
Assignees
Milestone

Comments

@srkprasadam
Copy link

srkprasadam commented Aug 8, 2017

GWT version:2.8.0
Browser (with version):Chrome - Version 59.0.3071.115 (Official Build) (64-bit)
Operating System:windows


Description

Emulation for toLowerCase and toUpperCase methods on a String is different in GWT

public String toLowerCase() {
return asNativeString().toLowerCase();
}

public String toUpperCase() {
return asNativeString().toLocaleUpperCase();
}

The uppercase method is doing Locale specific conversion, which is causing problems for us with Turkish users.

Steps to reproduce

Use String uppercase on a Turkish locale VM

Known workarounds
Links to further discussions
@tbroyer
Copy link
Member

tbroyer commented Aug 8, 2017

I think you can use toUpperCase(Locale.ROOT). toString is supposed to be locale-dependent.

@gkdn
Copy link
Contributor

gkdn commented Aug 8, 2017

Unlike Java we chose to be not locale specific by default with toLowerCase/toUpperCase but it looks like this patch introduced a regression to toUpperCase :/

You can work around it in a forward compatible way by passing it explicitly as @tbroyer described.

@tbroyer tbroyer added this to the 2.8.2 milestone Aug 9, 2017
@srkprasadam
Copy link
Author

I understand that we can workaround this issue by passing Locale explicitly. But that is too much of inconvenience, as we has toUpperCase() all over in the code. Thanks for targeting this bug to 2.8.2

@tbroyer
Copy link
Member

tbroyer commented Sep 17, 2017

hubot pushed a commit that referenced this issue Sep 18, 2017
Introduced in 7db3a9b,
in GWT 2.8.0.

Bug: #9540
Bug-Link: #9540
Change-Id: I7e20b435c63a76934cb8194fd5cd86abfe9b528b
jDramaix pushed a commit to google/j2cl that referenced this issue Sep 27, 2017
commit 7e730fe14c533c2975dd77554ad738b28773ec0e
Author: Thomas Broyer <t.broyer@gmail.com>
Date:   Sun Sep 17 18:14:34 2017 +0200

    Fix regression in String.toUpperCase becoming locale-dependent

    Introduced in 7db3a9b966fac5e397a162c23d68aa220662bec0,
    in GWT 2.8.0.

    Bug: #9540
    Bug-Link: gwtproject/gwt#9540
    Change-Id: I7e20b435c63a76934cb8194fd5cd86abfe9b528b

PiperOrigin-RevId: 170113254
akbertram added a commit to bedatadriven/activityinfo that referenced this issue Dec 15, 2017
GWT 2.8 was released with a regression/change that led to toUpperCase()
being locale-dependent. This has been fixed in GWT 2.8.2:
gwtproject/gwt#9540
akbertram added a commit to bedatadriven/activityinfo that referenced this issue Dec 15, 2017
GWT 2.8 was released with a regression/change that led to toUpperCase()
being locale-dependent. This has been fixed in GWT 2.8.2:
gwtproject/gwt#9540

This commit upgrades to GWT 2.8.2 and Java 1.8
akbertram added a commit to bedatadriven/activityinfo that referenced this issue Dec 16, 2017
GWT 2.8 was released with a regression/change that led to toUpperCase()
being locale-dependent. This has been fixed in GWT 2.8.2:
gwtproject/gwt#9540

This commit upgrades the entire project to GWT 2.8.2 and Java 1.8,
as well as moving to the new Java8 AppEngine runtime.
akbertram pushed a commit to bedatadriven/gwt that referenced this issue Dec 17, 2017
Introduced in 7db3a9b,
in GWT 2.8.0.

Bug: gwtproject#9540
Bug-Link: gwtproject#9540
Change-Id: I7e20b435c63a76934cb8194fd5cd86abfe9b528b
akbertram added a commit to bedatadriven/activityinfo that referenced this issue Dec 17, 2017
A regression in String.toUpperCase() in GWT 2.8.0 now prevents users
whose operating system is set to the Turkish locale from loading AI:
gwtproject/gwt#9540

As we use String.toUpperCase() to parse the lower case JSON string "single"
to the uppercase Cardinality.SINGLE.

This regression is fixed in GWT 2.8.2, but upgrading to GWT 2.8.2 appears
to require a bit more work to deal with changes to the GWT compiler anticipating
Java 9.

In the meantime, I've deployed a patched build of GWT 2.8.0 with the fix
for the above regression to nexus.bedatadriven.com:
https://github.com/bedatadriven/gwt/tree/v2.8.0-patched

And updated here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants