kotlin euc-kr to utf-8 conversion
·
Kotlin
euc-kr 로 된 자막파일을 utf-8 로 변환하기 위해 사용한 것 import java.nio.charset.Charset import java.nio.file.Files import kotlin.io.path.Path import kotlin.io.path.extension import kotlin.io.path.readBytes fun main() { // 해당 경로의 파일 목록을 가져오기 val stream = Files.list(Path("path/files")) // smi 파일들만 필터링 stream.filter { it.extension == "smi" } .forEach { // 파일을 byte array 로 변환 val bytes = it.readBytes() // string 으로 ..