For string values in queries, the generated SQL results in inline values with the prefix "_UTF8". E.g,
dataContext.Articles.Where(a => a.Name=="Mülltüte")
generates SQL such as
SELECT * FROM "ARTICLE" WHERE "NAME"=_UTF8'Mülltüte'
That works as long as the connection charset is set to "UTF8". In case the connection string defines a charset such as "WIN1252" the execution throws an error "Dynamic SQL Error, SQL error code = -104, Malformed string" (when e.g. the value contains an umlaut).
After removing the "_UTF8" prefix everything works fine (both WIN1252 and UTF8 charset):
SELECT * FROM "ARTICLE" WHERE "NAME"='Mülltüte'
Because of the following code in SqlGenerator.cs, Visit(DbConstantExpression)
// constant is always considered Unicode
isUnicode = true;
The "_UTF8" prefix will always be generated - no matter which charset was used to connect.
In my opinion it is not possible to use string values in queries with charsets other than UTF8. The "_UTF8" prefix should only be added in case the database connection uses UTF8, too.
Otherwise: Is it safe to connect via UTF8 to a database with WIN1252 as charset for columns or are there any side effects?