import degree symbol (°) from excel or csv file to mssql database

和自甴很熟 提交于 2019-12-11 12:53:17

问题


I have a field in my csv file which contains the text: Frozen at 20°C

but when i import into my database it appears as: Frozen at 20�C

anyone know how i can keep the correct degree symbol?

my import code looks like this

string fieldValue = csv[i].Trim();

回答1:


I just needed to specify Encoding.Default when creating my stream reader

CsvReader csv = new CsvReader(new StreamReader(file.InputStream, Encoding.Default), true)

Thanks for all the help Stephane you got me there in the end.



来源:https://stackoverflow.com/questions/3830512/import-degree-symbol-from-excel-or-csv-file-to-mssql-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!