ruby读取txt后,txt中的中文乱码
伊谢尔伦
伊谢尔伦 2017-04-24 09:13:20
0
2
849

ruby 读取txt后 txt中的中文乱码

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
Peter_Zhu

This situation usually occurs when the encoding of the text file is inconsistent with the system encoding. You need to first figure out what the encoding of the text file is, and then

File.read('your_file.txt', 'r:YOUR_ENCODING')
巴扎黑

Is it an encoding problem? Preferably encoded in UTF-8

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!