whi*_*eed 1 ruby encoding ascii utf-8
我从api得到这个值,不知怎的,它在值中发送了一些特殊的unicode字符.我想将其转换为普通的ascii字符串.
Abe*_*ker 6
使用unidecodergem:
unidecoder
require 'unidecoder' "Hary?na".to_ascii # => "Haryana"
归档时间:
12 年,7 月 前
查看次数:
44 次
最近记录: