Harden charset-as-string taking function deprecations.

Fix usages in compiler.
This commit is contained in:
Ilya Gorbunov
2016-01-19 20:54:29 +03:00
parent 6d5a65cac6
commit c1ad82ff8c
9 changed files with 32 additions and 34 deletions
+2 -4
View File
@@ -74,10 +74,8 @@ class StringJVMTest {
}
@test fun toByteArrayEncodings() {
val s = "hello"
val defaultCharset = java.nio.charset.Charset.defaultCharset()!!
assertEquals(String(s.toByteArray()), String(s.toByteArray(defaultCharset)))
assertEquals(String(s.toByteArray()), String(s.toByteArray(defaultCharset.name())))
val s = "hello®"
assertEquals(String(s.toByteArray()), String(s.toByteArray(Charsets.UTF_8)))
}
@test fun toCharArray() {