Unicode conversion fails
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs
- 领域
- database
调研方向
使用报告中的 macOS、unixODBC 和 SQL Server 配置,通过 Node.js 连接重现 Unicode 插入,然后将其 ODBC 调试编码行与 isql 结果进行比较。当通过 node-odbc 插入 Ω 后仍能保留该字符时,该 Issue 即得到解决;报告中未指出源文件或测试。
由索引模型根据 Issue 内容生成。
描述
Hi,
The test environment setup:
- MacOS Ventura
- unixODBC driver manager version 2.3.11
- Microsoft ODBC Driver 18 For SQL Server
- SQLServer running in Docker (or on a Windows machine)
Database has a single table:
create` table test (col1 `nvarchar(100));
Tested connection to the database with isql (command line tool) and issued the following statement:
insert into test (col1) values (N'Ω');
- result is OK
Tested connection with nodejs and issued the same statement as above on the connection:
const statement = `insert into IR_TSTGIN.dbo.test (col1) values (N'Ω');`
const result = await connection.query(statement);
- Statement is executed but the result is not OK. The omega charactered is converted to another symbol.
Ran both statements above (via isql and with nodejs) with odbc debug enabled.
- running with isql the log contains a message:
[ODBC][47379][1679320146.155152][SQLAllocHandle.c][395]
Entry:
Handle Type = 2
Input Handle = 0x7f987c815200
UNICODE Using encoding ASCII 'UTF-8' and UNICODE 'UCS-2-INTERNAL'
- running through nodejs the log contains the following message:
[ODBC][46268][1679319075.820124][SQLAllocHandle.c][395]
Entry:
Handle Type = 2
Input Handle = 0x7f8a88012600
UNICODE Using encoding ASCII 'US-ASCII' and UNICODE 'UCS-2-INTERNAL'
It seems that the locale settings are not applied when connecting via NodeJS odbc to the driverManager.
The locale settings are:
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
- 主要语言
- JavaScript
- 星标
- 159
- 派生
- 92
- 平均合并
- 5 小时 59 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
IBM/node-odbc 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
-
security
难度 3/5 1-2 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 38/100
相似的 Issue
-
check:passed feeds:remove
难度 1/5 1 小时以内 新手友好度 65/100
iptv-org/database#37176 · 1 条评论 · 1 个 reaction ·
维护者通常 9 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
hawk-digital-environments/HAWKI#443 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
feedback simulation workshop
难度 2/5 1-3 小时 新手友好度 66/100
githubnext/gh-aw-workshop#4370 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
AltimateAI/vscode-dbt-power-user#2089 ·