-
Notifications
You must be signed in to change notification settings - Fork 14
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
PostgreSQL 17.2 Npgsql development string garbled #219
Comments
Normally, UTF8 supports Simplified Chinese. Is my understanding incorrect ? |
Npgsql version : 9.0.2, I choose Locale : Chinese (Simplified), China, installing Tip : Warning - Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed |
Only choose -> Locale : [Default locale] can install success. |
var connectionString = "Host=127.0.0.1;Username=postgres;Password=mypassword;Database=postgres;Encoding=GB2312;";Set Encoding=GB2312; After execution, the prompt is normal. {"28P01: 用户 "postgres" Password 认证失败"} |
but, new question : I got garbled again when using GB2312 encoding to execute the Create table statement, var connectionString = "Host=127.0.0.1;Username=postgres;Password=mypassword;Database=postgres;Encoding=GB2312;"; Create Table Result :{"42601: 璇硶閿欒 鍦?")" 鎴栭檮杩戠殑\r\n\r\nPOSITION: 1235"} I changed GB2312 to UTF8 again and it's normal, May I ask which encoding is correct ? |
hello, I am using the postgresql-17.2-2-windows-x64.exe installation package, my operating system is Win11 24H2, My development tool is Microsoft Visual Studio Community 2022 (64 位) 17.12.3, The project engineering is the blazor web app (Server Mode),
My operating system environment is Simplified Chinese.
When installing, I encountered the 'Locale' option and chose 'Default Locale'.
Locale : Default locale
My Home.razor code :
@page "/"
@using Npgsql
Home
Hello, world!
Welcome to your new app.
<button class="btn btn-primary" @OnClick="IncrementCount">Click me
@code{
private async void IncrementCount()
{
try{
var connectionString = "Host=127.0.0.1;Username=postgres;Password=mypassword;Database=postgres;Pooling=true;Encoding=UTF8;";
}
Exception ex Msg return -> {"28P01: �û� "postgres" Password ��֤ʧ��"}
I used pgAdmin4 to check that the database encoding is UTF8.
SQL :
SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'postgres';
Did I make a mistake in choosing something?Could you please teach me? Thank you
The text was updated successfully, but these errors were encountered: