test/jdk/java/net/httpclient/CancelledResponse.java
branchhttp-client-branch
changeset 56076 9a2855e0a796
parent 56070 66a9c3185028
child 56089 42208b2f224e
--- a/test/jdk/java/net/httpclient/CancelledResponse.java	Tue Feb 06 10:34:47 2018 +0000
+++ b/test/jdk/java/net/httpclient/CancelledResponse.java	Tue Feb 06 11:04:44 2018 +0000
@@ -50,6 +50,7 @@
 
 import static java.lang.String.format;
 import static java.lang.System.out;
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
 
 /**
  * @test
@@ -73,7 +74,9 @@
         if (!serverKeepalive)
             sb.append("Connection: Close\r\n");
 
-        sb.append("Content-length: ").append(body.length()).append("\r\n");
+        sb.append("Content-length: ")
+                .append(body.getBytes(ISO_8859_1).length)
+                .append("\r\n");
         sb.append("\r\n");
         sb.append(body);
         return sb.toString();