encode_json 会对给定的Perl的数据结构转换为一个UTF-8 encoded, binary string.
2016-07-11 07:49
253 查看
use JSON qw/encode_json decode_json/ ; use Encode; my $data = [ { 'name' => 'Ken' , 'age' => 19 }, { 'name' => '测试' , 'age' => 25 } ]; print encode_utf8("'name' => '测试'"); print "\n"; my $json_out = encode_json ( $data ); print $json_out; print "\n"; encode_json $json_text = encode_json $perl_scalar Converts the given Perl data structure to a UTF-8 encoded, binary string. This function call is functionally identical to: $json_text = JSON->new->utf8->encode($perl_scalar) encode_json 会对给定的Perl的数据结构转换为一个UTF-8 encoded, binary string.
相关文章推荐
- encode_json 会对给定的Perl的数据结构转换为一个UTF-8 encoded, binary string.
- encode_json 会对给定的Perl的数据结构转换为一个UTF-8 encoded, binary string.
- 数据结构之堆的定义
- 数据结构(虚树,动态规划):HNOI 2014 世界树
- 格雷码(Gray Code)的生成
- Swift 3.0在集合类数据结构上的一些新变化总结
- 用LinkedList链表模拟 堆栈、队列 两种数据结构
- 1001. A+B Format (20)
- 判断单链表是否为回文
- 二叉树应用-Huffman树类模板的实现(数据结构基础 第6周)
- 单链表_链表倒置
- 二叉树应用-Huffman编码树(数据结构基础 第6周)
- MFT的0x10标准属性数据结构
- 数据结构之栈
- 半边数据结构
- ArrayListDemo
- 数据结构——线性表的实现
- 数据结构之拓扑排序
- 定制化高效使用Map的一些经验技巧
- 数据结构-单链表