【发布时间】:2016-12-07 06:16:20
【问题描述】:
我正在使用 https://github.com/brianc/node-postgres pg 模块。显然我不能使用 Unicode 密码连接到数据库。从具有连接参数的同一位置psql 正常。使用 Node.js,它提供了 ne password authentication failed for user。当我与console.log() 核对时,我看到的正是我所期望的。如果我在数据库和连接字符串中都将密码更改为 ASCII,一切正常。但我需要使用旧的 Unicode 密码...
我都试过https://github.com/brianc/node-postgres/wiki/Client
new pg.Client({...password: Código
和
conString = "postgres://...Código@"
我知道 ODBC (Driver={PostgreSQL UNICODE};) 和 JDBC (;Unicode=true) 在连接字符串中都支持 UTF。我在 Node.js pg 模块 UTF 支持上一无所获。
请帮忙。
我看到了http://www.connectionstrings.com/postgresql/ 并阅读了https://github.com/brianc/node-postgres 上的文档。请帮忙解答问题。
谢谢!
【问题讨论】:
-
github.com/bnoordhuis/node-iconv 会有帮助吗?..
-
@brianc 你能看一下吗?..
标签: node.js postgresql unicode node-postgres