leonardBang commented on a change in pull request #11334: 
[FLINK-16464][sql-client]result-mode tableau may shift when content contains 
Chinese String in SQL CLI
URL: https://github.com/apache/flink/pull/11334#discussion_r389232752
 
 

 ##########
 File path: 
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/cli/CliTableauResultViewTest.java
 ##########
 @@ -167,8 +177,9 @@ public void testBatchResult() {
                                "|   false | -2147483648 |  9223372036854775807 
|                     (NULL) |    12345.06789 |    2020-03-01 18:39:14.123 |\n" 
+
                                "|    true |         100 | -9223372036854775808 
|                 abcdefg111 |         (NULL) | 2020-03-01 18:39:14.123456 |\n" 
+
                                "|  (NULL) |          -1 |                   -1 
| abcdefghijklmnopqrstuvwxyz |   -12345.06789 |                     (NULL) |\n" 
+
+                               "|  (NULL) |          -1 |                   -1 
|         这是一段中文 |   -12345.06789 |      2020-03-04 18:39:14.0 |\n"     +
 
 Review comment:
   The problem is that UTF-8 char's display width is different with UTF-8 
char's bytes length. `"这是一段中文".getBytes().length()` will return 18 because 
length of Chinese char is 3 in UTF-8 unicode,here we can use GBK unicode which 
Chinese char's length is 2. 
   But GBK is not common enough than UTF-8.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to