Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unicode conversion fails

オープン
#319 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, nodejs
領域
database

調査の方向性

報告されている macOS、unixODBC、SQL Server のセットアップを使用し、Node.js 接続経由で Unicode の挿入を再現してから、その ODBC デバッグエンコーディング行を isql の結果と比較します。node-odbc 経由で Ω を挿入したときに文字が保持されれば、Issue は解決です。報告にはソースファイルもテストも特定されていません。

索引モデルが issue の本文から書いたものです。

説明

confirmed

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分
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

IBM/node-odbc のほかの issue

IBM/node-odbc の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。