public inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Magnus Johansson <magnus.johansson@digpro.se>
To: pgsql-sql@lists.postgresql.org <pgsql-sql@lists.postgresql.org>
Subject: pg_ls_dir and files with local characters
Date: Fri, 10 Apr 2026 12:05:49 +0000
Message-ID: <MRWPR01MB125758330358214208035A031AF592@MRWPR01MB12575.eurprd01.prod.exchangelabs.com> (raw)
Hello, I have a question regarding pg_ls_dir
I have a directory structure on my windows server (2025) where I run postgres 18
Some of the files listed has Swedish characters in the name.
Like this: Stocksnäsvägen-36-Stocksnäsvägen-36-Noah.pdf
When I run pg_ls_dir on that directory it is listed as this
SELECT * FROM pg_ls_dir('E:\Digpro\Bilder\Dokument\200891');
pg_ls_dir
----------------------------------------------
Stocksnasvagen-36-Stocksnasvagen-36-Noah.pdf
(1 rad)
My Swedish characters are changed to a, sometimes they disapear...
Done some research and I verified that the server and client encoding are the same
dps=# show server_encoding;
server_encoding
-----------------
UTF8
dps=# show client_encoding;
client_encoding
-----------------
UTF8
I have set codepage to utf8 in cmd prompt , chcp 65001
Suspect that this is Windows related, but cannot figure out what to change
Region settings has Swedish (Sweden) as preferred language and only language
I also have a ubuntu server with PG18, if I run the same example there the Swedish characters
Are presented properly. Encoding in PG is UTF8
Appreciate any comments on this.
Best Regards
--
Magnus Johansson
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: pgsql-sql@postgresql.org
Cc: magnus.johansson@digpro.se, pgsql-sql@lists.postgresql.org
Subject: Re: pg_ls_dir and files with local characters
In-Reply-To: <MRWPR01MB125758330358214208035A031AF592@MRWPR01MB12575.eurprd01.prod.exchangelabs.com>
* 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