简体   繁体   English

SQL Server和C#UTF8编码不正确

[英]SQL Server & C# UTF8 encoding not correct

I am getting a very big file from a linux box which I import with TOAD Wizard to SQL Server Express for testing 我从Linux盒中获取了一个很大的文件,该文件是使用TOAD向导导入到SQL Server Express进行测试的

The file is supposed to be correctly using special characters like ÄäÖö... which the admin of the box confirms. 该文件应该使用特殊字符(例如ÄäÖö...)正确显示,该字符会被盒子管理员确认。

I am seeing only misinterpreted characters (like Ä) via Putty&less, textviewer in windows, toads import wizard, inside the db and when returning the values in .net 我在通过Putty&less,Windows中的textviewer,toads导入向导,db内部以及在.net中返回值时只能看到错误解释的字符(如Ä)。

The only idea I have is to replace the characters in C# but for that I would need a complete list of replacements to do. 我唯一的想法是替换C#中的字符,但为此,我需要完整的替换列表。

Does anyone have such a list, a finished class or any other idea? 有人有这样的清单,完成的课程或任何其他想法吗?

I solved the problem by converting the file on the unix side: 我通过在Unix端转换文件解决了这个问题:

iconv unicode unknown input format iconv unicode未知输入格式

use iconv to upconvert UTF-8 to UTF-16 , which SQLServer can import correctly 使用iconv将UTF-8转换为UTF-16 ,SQLServer可以正确导入

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM