Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
476 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a native C++ Windows MFC application that accesses sqlite3.dll to load data from a database and it loads non-ASCII characters like 'ñ' without changing them to '?'
When I access this database from EntityFramework, the non-ASCII characters get represented like '?' instead. Where can I configure EF or ADO.NET to correct this?
The related field is either first_name or last_name., both behave the same when dealing with non-ASCII characters
Thanks
I cannot reproduce this issue with default installation of Sqlite an ASP.NET Core MVC application.
I'm guessing there is something else going on with your application. How or where are you displaying the text?
I am writing spanish text in a MFC EditBox and reading its value into a CString. The letter ñ inside the CString has a value of 241. Then I convert from CString (which is a wide string) to 7 bit string by using this code:
And when I inspect the returned string the value for the ñ is -15 (which is 241-256) -- its out of range for a 8 bit signed char (which is 7 bits + the sign bit)...
Inside the debugger ñ is well displayed as ñ. All seems to be okay but when I load the string in a .NET application, the character ñ value is 65533 and it does not display as ñ!!
So it is an encoding problem!!
Looking at the character map application that is part of Windows 10 Pro, I can verify that ñ has a value of 241 in the unicode character set as well as the DOS : United States character set which is also 241
you can try
https://geeksarray.com/blog/using-fluent-api-in-efcore-code-first
Sign in to comment
1 answer
Sort by: Most helpful
I advice to you use entityframework and be careful your database column variable types.
Sign in to comment