当前位置:网站首页>Old ou, a fox friend, has had a headache all day. The VFP format is always wrong when it is converted to JSON format. It is actually caused by disordered code

Old ou, a fox friend, has had a headache all day. The VFP format is always wrong when it is converted to JSON format. It is actually caused by disordered code

2022-06-25 11:44:00 VFP of Garfield

Old Ou of the fox Friends Association sent a question , Say conversion JSON Always wrong .
The following figure shows the normal situation

But taking multiple pieces of data becomes

If you look carefully, , You'll find the second paragraph data It becomes a string .

So the cat helped him look at it remotely , Open the database , One field is TEXT type , It's full of garbled code , So the cat knows in his heart , His data is from txt The text file is imported into SQLSERVER, Failure to deal with the problems caused by coding .

 The statement

Look at this mess TXT File is UTF-8, When importing, you selected 936 As a result of , So the cat opened his source txt file . I am a WIN7 The Notepad status bar does not display the encoding type , Lao Ou's computer is win10 There is a display .
So save as ansi Format .

Open it again SQL2008 Import and Export Wizard , Garbled code is normal

Of course, you can also choose to txt Save as unicode,SQL2008 The import and Export Wizard will recognize as unicode instead of GBK936, The converted field types will also become nvarchar.

More information :www.sn58.cn

原网站

版权声明
本文为[VFP of Garfield]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200535522991.html