public inbox for [email protected]  
help / color / mirror / Atom feed
From: =?utf-8?B?ZWxvZGll?= <[email protected]>
To: =?utf-8?B?cGdzcWwtYnVncw==?= <[email protected]>
Subject: Chinese translations not applied correctly on PostgreSQL 18 Windows
Date: Thu, 23 Apr 2026 10:03:32 +0800
Message-ID: <[email protected]> (raw)

Hi there,


Here I'd like to report an issue encountered during my use of PG18.




Description:
Chinese translations exist in the .mo file but are not being used at runtime for error messages on PostgreSQL 18 Windows.


Environment:
- PostgreSQL version: 18.0
- OS: Windows 10 x64 (Build 17763)
- Installation: EnterpriseDB installer (postgresql-18.0-1-windows-x64.exe)
- Locale: zh_CN (Chinese Simplified)
- Database encoding: UTF8


Steps to reproduce:
1. Install PostgreSQL 18 on Windows
2. Set environment: LANG=zh_CN, chcp 936
3. Run psql and execute: INSERT INTO tb (c) VALUES ('a\O\0');


Expected output (based on .mo file translations):
错误: 无效的 "UTF8" 编码的字节顺序: 0x00


Actual output:
WARNING: nonstandard use of escape in a string literal
第1行INSERT INTO tb (c) VALUES ('a\O\0');
&nbsp;^
提示: Use the escape string syntax for escapes, e.g., E'\r\n'.
ERROR: invalid byte sequence for encoding "UTF8": 0x00


Observations:
- Some parts ARE translated: "第1行" (line 1), "提示" (HINT)
- Main messages are NOT translated: "WARNING", "ERROR", error text
- The .mo file at C:\Program Files\PostgreSQL\18\share\locale\zh_CN\LC_MESSAGES\postgres-18.mo contains 5214 translations including:
&nbsp; - "ERROR" → "错误"
&nbsp; - "WARNING" → "警告"
&nbsp; - "nonstandard use of escape in a string literal" → "字符串常量中以非标准的方法使用转义字符"
&nbsp; - "invalid byte sequence for encoding \"%s\": %s" → "无效的 \"%s\" 编码的字节顺序: %s"


Translation file verified:
The translations exist in the .mo file but are not being applied at runtime.


Possible cause:
This appears to be a bug in PostgreSQL 18's gettext internationalization on Windows, where some message types are not being correctly localized.


---


Please let me know if you need any additional information.



Thanks and Best Regards!


Elodie Fu


elodie
[email protected]

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Chinese translations not applied correctly on PostgreSQL 18 Windows
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox