Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character data test - character sets #77

Closed
imanuelcostigan opened this issue Jun 5, 2016 · 3 comments
Closed

Character data test - character sets #77

imanuelcostigan opened this issue Jun 5, 2016 · 3 comments

Comments

@imanuelcostigan
Copy link
Contributor

One of the parts of the data_character() tests is executing the following query: SELECT 'Кирилл' AS A.

By default, this will return ????? in SQL Server (even natively). What needs to be executed is SELECT N'Кирилл' AS A. This is because, by default, SQL Server uses a non-UNICODE character set so one needs to declare a string literal as UNICODE using the N' prefix.

As a result this test case fails.

@krlmlr
Copy link
Member

krlmlr commented Jun 5, 2016

Is the N prefix part of the standard, or a SQL server extension? Anyway, we might need a tweak here.

@imanuelcostigan
Copy link
Contributor Author

i suspect the latter. A quick search suggests that maybe Oracle has a similar "feature"

@krlmlr
Copy link
Member

krlmlr commented Jun 5, 2016

From T-SQL docs:

Unicode strings have a format similar to character strings but are preceded by an N identifier (N stands for National Language in the SQL-92 standard).

MySQL and PostgreSQL accept this syntax (I'm not sure about the semantics), SQLite rejects it.

MySQL has "introducers", too, looks like you can ask SELECT _utf8'text'. However, things work out without these introducers here because the connection character set is changed to utf8 first thing after establishing the connection. I suspect this isn't possible with jTDS (see somewhat related SO question), but I might be wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants