src/java.base/share/classes/sun/nio/cs/UTF_8.java

Print this page
rev 10701 : 8058875: CharsetEncoder.maxBytesPerChar() should return 4 for UTF-8

@@ -553,11 +553,11 @@
 
     private static final class Encoder extends CharsetEncoder
                                  implements ArrayEncoder {
 
         private Encoder(Charset cs) {
-            super(cs, 1.1f, 3.0f);
+            super(cs, 1.1f, 4.0f);
         }
 
         public boolean canEncode(char c) {
             return !Character.isSurrogate(c);
         }