How can js convert csv files or string to UTF-8 format

such as the title, because to import the data in the csv file, the file format is not UTF-8, it is garbled on the web page, as shown in the following figure.

if it is in UTF-8 format, the display is normal Chinese, no problem.

so I"d like to ask you how to convert CSV file format to UTF-8 through transcoding in js. Thanks a lot.

Mar.10,2021

get the original data and find a decoding library to decode


how to encode and decode the string GBK and GB2312 on the browser side?

if you read the article carefully, you will find that the author has opened up its library
you can use

npm install -S web-iconv

to install and use

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eae406-21bc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eae406-21bc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?