From 713388adb770e103ef8bc625fb80d41db2f1e8ee Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Sun, 5 Jan 2025 16:06:12 +0800 Subject: [PATCH] Fix testDecode_Backspace (#15034) --- .../java/org/apache/dubbo/remoting/codec/TelnetCodecTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/codec/TelnetCodecTest.java b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/codec/TelnetCodecTest.java index e0e06642892..d36c1d64a9f 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/codec/TelnetCodecTest.java +++ b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/codec/TelnetCodecTest.java @@ -247,7 +247,7 @@ void testDecode_Backspace() throws IOException { testDecode_assertEquals(new byte[] {'\b'}, Codec2.DecodeResult.NEED_MORE_INPUT, new String(new byte[] {32, 8})); // test chinese - byte[] chineseBytes = "中".getBytes(); + byte[] chineseBytes = "中".getBytes(StandardCharsets.UTF_8); byte[] request = join(chineseBytes, new byte[] {'\b'}); testDecode_assertEquals(request, Codec2.DecodeResult.NEED_MORE_INPUT, new String(new byte[] {32, 32, 8, 8})); // There may be some problem handling chinese (negative number recognition). Ignoring this problem, the