thymeleaf-testing icon indicating copy to clipboard operation
thymeleaf-testing copied to clipboard

the Chinese characters were garbled in test file

Open shalom-he opened this issue 4 years ago • 0 comments

%CONTEXT onevar = '商品' goods = #{'title': '电脑主机', 'price': 1000}

%MESSAGES msg = '商品'


DefaultContextStandardTestFieldEvaluator.getValue

            /*
             * This String -> byte[] conversion is needed because java.util.Properties 
             * did not allow using a java.io.Reader for loading properties until Java 6.
             */
            final byte[] valueAsBytes = fieldValue.getBytes("ISO-8859-1");
            final ByteArrayInputStream inputStream = new ByteArrayInputStream(valueAsBytes);

Why utf8 encoding is not supported? My JDK version is 1.8

shalom-he avatar May 12 '20 09:05 shalom-he