should not use String#length

String header should not character count, but byte size.

for example
```
$ scala
Welcome to Scala version 2.11.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
Type in expressions to have them evaluated.
Type :help for more information.

scala> "あ".length
res0: Int = 1

scala> "あ".getBytes("UTF-8").length
res1: Int = 3
```