Home> Web Front-end> uni-app> body text

How to solve the problem of uniapp displaying garbled characters

藏色散人
Release: 2020-12-17 16:39:44
Original
9768 people have browsed it

Uniapp displays garbled characters because the encoding when UniAPP reads the TxT file is inconsistent. The solution: first open the corresponding code file; then change "readastext(file,"utf8");" to "readastext( file,"gbk");" That's it.

How to solve the problem of uniapp displaying garbled characters

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version. This method is suitable for all brands of computers.

Recommended (free):uni-app development tutorial

UniAPP reads the content of the TxT file on the mobile phone, and the result is Chinese garbled characters? How to solve it?

How to solve the problem of uniapp displaying garbled characters

Solution:

Change the "utf-8" in the first red box to "GBK".

The above is the detailed content of How to solve the problem of uniapp displaying garbled characters. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
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!