C#读取SQLite数据库中文乱码 C#在读取C++写入数据的Sqlite数据库中的Text内容时,会出现乱码,因为C++默认编码格式为GB2312,而Sqlite编码格式为UTF-8,存入时不统一就会出现乱码 using System; using System.Data; using System.Data.SQLite; using System.Text; namespace SQLiteSamples { class Program { //数据库连接 SQLiteConnection
http://hi.baidu.com/linjk03/item/e2028bfd990c14ea1a111feb 统一了输入输出的编码格式,是不会有乱码问题出现的. 构造Reader或Writer时,指定编码格式. in = new BufferedReader(new InputStreamReader(socket.getInputStream(),"UTF-8")); out = new BufferedWriter(new OutputStreamWriter(socke