diff --git a/Sources/Classes/core/View/MiniAppViewHandler.swift b/Sources/Classes/core/View/MiniAppViewHandler.swift index f6e43c35..debd8890 100644 --- a/Sources/Classes/core/View/MiniAppViewHandler.swift +++ b/Sources/Classes/core/View/MiniAppViewHandler.swift @@ -939,7 +939,8 @@ extension MiniAppViewHandler { // swiftlint:enable file_length function_body_length extension String { - func base64Encoded() -> String? { - data(using: .utf8)?.base64EncodedString() - } + func base64Encoded() -> String? { + guard let data = data(using: .nonLossyASCII) else { return "" } + return data.base64EncodedString() + } }