-
Notifications
You must be signed in to change notification settings - Fork 374
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
SQLSTATE[HY000]: [Microsoft][ODBC Driver 18 for SQL Server]Unicode conversion failed #1479
Comments
What does the server give when running |
|
I can't seem to reproduce this one. I can execute the select query just fine with no errors. Also the table create query appears to be incorrect, the default values and NULL settings have to come after |
It's OCRD table for SAP B1 database, you can find it here https://sap.erpref.com/?schema=BusinessOne9.3&module_id=3&table=OCRD The query can run in HeidiSQL, MS Azure Data Studio... but if I run in |
I just updated the table creation, generate from MS Azure Data Studio should be correct one. |
Just found this https://stackoverflow.com/a/77140830/223934 But the problem doesn't exist if I don't update. Do you have any idea? |
Probably that type of conversion isn't available by default on Alma Linux, I'm not sure since that's not an officially supported OS. |
Not only Alma Linux, but the entire Fedora family (including RHEL, Oracle Linux, Centos). For some distros, I think the ODBC should verify the dependency when installing. |
If installing glibc-gconv-extra on Red Hat x glibc systems solve the problem, does a solution exist on Alpine Linux x musl systems? |
I don't believe that package is available on Alpine, but what encodings are you looking for? |
My question is related to this stackoverflow question where the error could be a lack of enconding support for Japanese. |
Alpine's iconv does not have encodings for Japanese (among others). There is a Here's the page for it, with more info: https://www.gnu.org/software/libiconv/ |
PHP version
8.1.23
PHP SQLSRV or PDO_SQLSRV version
php-sqlsrv-5.11.1-1.el9.remi.8.1.x86_64
Microsoft ODBC Driver version
[ODBC Driver 18 for SQL Server]
SQL Server version
Microsoft SQL Server 2016
Client operating system
Alma Linux 9.2 (WSL)
Table schema
Collate
SQL_Latin1_General_CP1_CI_AS
Problem description
I run simple query in my app (connect via php-sqlsrv)
select top 1 [CardType] from [dbo].[OCRD] where [CardCode] = 'MyClientCode'
and it raised error:SQLSTATE[HY000]: [Microsoft][ODBC Driver 18 for SQL Server]Unicode conversion failed
I run in
sqlcmd
, it will have error:Sqlcmd: Error: Internal error at ReadAndHandleColumnData (Reason: Error reading column data). Unicode conversion failed
Expected behavior and actual behavior
Expected result: 'C'
Actual Result: Unicode conversion failed
Run in Laravel via sqlsrv extension
Run directly in
sqlcmd
utilityExpected result (run in Azure Data Studio, on Windows, it works)
Repro code or steps to reproduce
Just run
select top 1 [CardType] from [dbo].[OCRD] where [CardCode] = 'MyClientCode'
in your app connect viasqlsrv
or insqlcmd
utility, it will throw errorThe text was updated successfully, but these errors were encountered: