Fix StringStringCodec length check 39/95339/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 24 Feb 2021 08:47:30 +0000 (09:47 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 24 Feb 2021 10:07:26 +0000 (11:07 +0100)
RFC7950 specifies that string length is counted in unicode
characters. String.length() returns the length in code units of
UTF-16, which are not the same thing.

Use String.codePointCount() to get correct results for strings
containing characters from outside of Unicode BMP.

JIRA: YANGTOOLS-1224
Change-Id: I6ff9557d61449625be975eaca00ad235bf429155
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit cbadacd601e11552b749edfaaa19b64b9804e55f)


No differences found