You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ByteStringUtil.longestCommonPrefix(...) method isn't working when one of its parameters is a String and the other a Compact or Replazable String, in the internal strings (Replazable/Compact), the charAt(i) methods are returning byte[i] and in a string, it returns the character at location i, so if we are using non ASCII characters, we are using more than one byte. For example (Shorten value of a Wikidata literal of Q101213907)
The ByteStringUtil.longestCommonPrefix(...) method isn't working when one of its parameters is a String and the other a Compact or Replazable String, in the internal strings (Replazable/Compact), the
charAt(i)
methods are returningbyte[i]
and in a string, it returns the character at location i, so if we are using non ASCII characters, we are using more than one byte. For example (Shorten value of a Wikidata literal of Q101213907)The string value is
"\u00C2\u00A0" = char[] {0xC2, 0xA0}
The internal value is
utf8("\u00A0") = byte[] {0xC2, 0XA0}
cf: UTF8
In the code, it is used 2 internal strings, but because the method is public, it might be better to fix it if someone is using the library method.
The text was updated successfully, but these errors were encountered: