diff options
-rw-r--r-- | src/main/kotlin/CryptoHandler.kt | 4 | ||||
-rw-r--r-- | src/main/kotlin/FileController.kt | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/kotlin/CryptoHandler.kt b/src/main/kotlin/CryptoHandler.kt index 145f3e6..e3f33df 100644 --- a/src/main/kotlin/CryptoHandler.kt +++ b/src/main/kotlin/CryptoHandler.kt @@ -32,12 +32,12 @@ internal constructor(private val secretKey: SecretKey, cipher: String) { cipher.init(Cipher.DECRYPT_MODE, secretKey, IvParameterSpec(iv)) CipherInputStream(fileIn, cipher).use { cipherIn -> - InputStreamReader(cipherIn).use { inputReader -> + InputStreamReader(cipherIn, Charsets.UTF_8).use { inputReader -> BufferedReader(inputReader).use { reader -> val sb = StringBuilder() var line: String? = reader.readLine() while (line != null) { - sb.append(line) + sb.append(line + "\n") line = reader.readLine() } content = sb.toString() diff --git a/src/main/kotlin/FileController.kt b/src/main/kotlin/FileController.kt index d37c552..b1c26dd 100644 --- a/src/main/kotlin/FileController.kt +++ b/src/main/kotlin/FileController.kt @@ -114,7 +114,7 @@ class FileController { val fileLocation = "$fileHome/$userId/$fixedName" var addPath = "" - val stringContent = content.bufferedReader().use { it.readText() } + val stringContent = content.bufferedReader(Charsets.UTF_8).use { it.readText() } fixedName.split("/").forEach { addPath += "$it/" |