-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
The convertCharset (s, 'utf-8', 'utf-16') doesn't seem to work properly. #7643
Comments
I found what public int hashCode() {
int h = hash;
if (h == 0 && value.length > 0) {
hash = h = isLatin1() ? StringLatin1.hashCode(value)
: StringUTF16.hashCode(value);
}
return h;
} |
But our strings have no information about encoding. The only way to solve is to provide another function |
To avoid BOM, you should specify
|
And probably we should add a function |
@alexey-milovidov |
Executed Query
Result of convertCharset
I set a break point at the javaHash() and checked what the value passed by convertCharset().
I expected the value as
97 0 49 0 0 -84
and the size to be 6.But, an actual value is not.
Notice that first two bytes are
-1 -2
. It looks weird.Versions
The text was updated successfully, but these errors were encountered: