[
https://issues.apache.org/jira/browse/HDDS-8724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727183#comment-17727183
]
Tsz-wo Sze commented on HDDS-8724:
----------------------------------
{code}
@Test
public void testFixedLengthStringCodec() throws Exception {
final Codec<String> codec = FixedLengthStringCodec.get();
final String original = "Ozone 是 Hadoop 的分布式对象存储系统,具有易扩展和冗余存储的特点。";
final byte[] encoded = codec.toPersistedFormat(original);
final String decoded = codec.fromPersistedFormat(encoded);
Assertions.assertEquals(original, decoded);
}
{code}
The test above will fail.
{code}
org.opentest4j.AssertionFailedError:
Expected :Ozone 是 Hadoop 的分布式对象存储系统,具有易扩展和冗余存储的特点。
Actual :Ozone ? Hadoop ?????????????????????????
{code}
> FixedLengthStringCodec may silently replace unsupported characters
> ------------------------------------------------------------------
>
> Key: HDDS-8724
> URL: https://issues.apache.org/jira/browse/HDDS-8724
> Project: Apache Ozone
> Issue Type: Sub-task
> Components: db
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Major
>
> FixedLengthStringCodec simply uses String.getBytes(ASCII_CSN) to encode a
> string. It may silently replace unsupported characters with '?'. It should
> throw an exception instead.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]