flutter base64对中文字段处理
import 'dart:typed_data';import 'dart:convert';var name ='我是谁哈哈哈哈.mp3';print('===字符: ${name}');String name2 = await base64Encode(utf8.encode(name));print('===编码后: ${name2}');Uint8List name3 = await ba
·
import 'dart:typed_data'; import 'dart:convert';
var name ='我是谁哈哈哈哈.mp3';
print('===字符: ${name}');
String name2 = await base64Encode(utf8.encode(name));
print('===编码后: ${name2}');
Uint8List name3 = await base64Decode(name2);
Utf8Decoder().convert(name3);
print('===解码后: ${Utf8Decoder().convert(name3)}');
输出:
===字符: 我是谁哈哈哈哈.mp3
===编码后: 5oiR5piv6LCB5ZOI5ZOI5ZOI5ZOILm1wMw==
===解码后: 我是谁哈哈哈哈.mp3
更多推荐
已为社区贡献4条内容
所有评论(0)