Use UTF-8 instead of ASCII for encoding (#44)
This commit is contained in:
parent
6d7bf62cf7
commit
bde475a49f
2 changed files with 2 additions and 2 deletions
|
|
@ -104,7 +104,7 @@ class Password {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getPlainData() -> Data {
|
func getPlainData() -> Data {
|
||||||
return getPlainText().data(using: .ascii)!
|
return getPlainText().data(using: .utf8)!
|
||||||
}
|
}
|
||||||
|
|
||||||
private func getAdditionValue(withKey key: String) -> String? {
|
private func getAdditionValue(withKey key: String) -> String? {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ extension PasswordEntity {
|
||||||
let encryptedDataPath = URL(fileURLWithPath: "\(Globals.repositoryPath)/\(rawPath!)")
|
let encryptedDataPath = URL(fileURLWithPath: "\(Globals.repositoryPath)/\(rawPath!)")
|
||||||
let encryptedData = try Data(contentsOf: encryptedDataPath)
|
let encryptedData = try Data(contentsOf: encryptedDataPath)
|
||||||
let decryptedData = try PasswordStore.shared.pgp.decryptData(encryptedData, passphrase: passphrase)
|
let decryptedData = try PasswordStore.shared.pgp.decryptData(encryptedData, passphrase: passphrase)
|
||||||
let plainText = String(data: decryptedData, encoding: .ascii) ?? ""
|
let plainText = String(data: decryptedData, encoding: .utf8) ?? ""
|
||||||
password = Password(name: name!, plainText: plainText)
|
password = Password(name: name!, plainText: plainText)
|
||||||
return password
|
return password
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue