postgresql - postgres npgsql with c# - trying to write special characters to an ascii encoded database -
i using open source library npgsql http://pgfoundry.org/projects/npgsql/ manipulate third party data on postgres database. database encoded sql_ascii.
if run query using standard c# string
insert cities(cityname) values("köln")
the value shows in database looks more like: пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ
e.g. scrambled. i've spent many hours trying use different string encodings etc no success
sql_ascii means turn off encoding functionality in database. it's make sure clients use same encoding. believe npgsql use utf8, , cannot changed.
so there no "the value shows in database" - depending on encoding client talks database in.
the best way fix set actual encoding in database, , set useful - such utf8 or latin1.
Comments
Post a Comment