Warning in psql console on Windows for none matching character encoding
@Eprince-hub ci sta già lavorando.
Dal 12/7/2024.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Related to https://github.com/upleveled/system-setup/issues/76
There is a warning in the psql console about character encoding that doesn't match the system encoding. Some Windows machines still use the legacy 1252 that may not support all utf-8 character encoding.
The warning from the psql console
WARNING: Console code page (850) differs from the Windows code page (1252). 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details.
Recommended Solution
- Set the Windows character encoding from
1252to utf-8
Not Recommended Solution
- Set the character encoding in psql to
1252(This may be setting the psql to use a legacy character encoding)
Some findings
- Character encoding 1252 is a legacy single-byte encoding
- The suggestions in Notes for Windows Users of Postgres don't work
- Some suggested solutions online don't persist after the terminal restart
client_encodingis already in UTF8 in psql but this doesn't solve the issue (I think the system and psql encoding need to match)
SHOW client_encoding;
client_encoding
-----------------
UTF8
(1 row)
Checking the system info with [System.Text.Encoding]::Default
System info before the checkbox is checked
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252
System info after the checkbox is checked (all 1252 changed to utf-8 and its 65001 number equivalent)
BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
IsSingleByte : False
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 65001
Conversation in https://github.com/upleveled/system-setup/pull/80 about this
https://github.com/upleveled/system-setup/pull/80/commits/60ddd090753fefa7b956e4c13eed5d9863a3efcc#r1668603246
https://github.com/upleveled/system-setup/pull/80/commits/60ddd090753fefa7b956e4c13eed5d9863a3efcc#r1674257929
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 30
- Fork
- 18
- Merge medio
- 22m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di upleveled/system-setup
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
upleveled/system-setup#121 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
upleveled/system-setup#46 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
upleveled/system-setup#123 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
upleveled/system-setup#122 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
upleveled/system-setup#118 ·