docker icon indicating copy to clipboard operation
docker copied to clipboard

Locale problem and support for UTF-8 file names

Open ricardojlrufino opened this issue 5 years ago • 9 comments

Used names of files and folders with accents (Brazil pt_BR). I had to set the chart and set the environment variables. To work I had to add these environment variables:

        env:
        - name: LC_ALL
          value: C.UTF-8
        - name: TZ
          value: America/SaoPaulo

Can you add this by default to avoid future problems?

ricardojlrufino avatar Apr 22 '19 20:04 ricardojlrufino

Would be be fine to add

LC_ALL=C.UTF-8
LANG=C.UTF-8

Without it I have some errors with large file names sync. This is worsened by another problem: something like ".ocTransferId1997286732.part" is added while ownCloud client tries upload file.

QuAzI avatar Apr 19 '20 17:04 QuAzI

Hey, since this issue seemed to have gotten lost among all the other open ones, I thought I'd leave a quick comment. I just experienced a problem with nextcloud this week regarding files and folders with unicode characters in their names (similar/identical to the problem described here).

I was able to fix said problem by adjusting the locale inside of the container from POSIX to en_US.UTF-8 using docker-compose's environment section:

environment:
  ...
  - "LC_ALL=en_US.UTF-8"
  - "LANG=en_US.UTF-8"
  - "LANGUAGE=en_US.UTF-8"
  ...

It would be lovely if an active maintainer could actually implement the locale setting directly into the Dockerfile, so that this has not to be done manually afterwards and to prevent a lot of confusion.

kurzdev avatar Mar 22 '21 14:03 kurzdev

@kurzdev do you want to PR this small change? I mean in the Dockerfile, not the compose.

pierreozoux avatar Mar 23 '21 22:03 pierreozoux

@pierreozoux Sure, do you want me to just edit the template Dockerfiles or the Dockerfiles for versions 19.0, 20.0 and 21.0 as well?

kurzdev avatar Mar 24 '21 10:03 kurzdev

I implemented @QuAzI's method of doing things as it seems more appropriate for the general public to not set the locale more specific than it has to be. As I stated in the pull request, this works only on debian-based images.

kurzdev avatar Mar 25 '21 17:03 kurzdev

Thanks a lot @kurzdev :)

pierreozoux avatar Mar 26 '21 15:03 pierreozoux

@ricardojlrufino did https://github.com/docker-library/php/pull/1187 fix your issue?

J0WI avatar Aug 27 '21 11:08 J0WI

Capture d’écran du 2022-06-12 18-07-45

LC_ALL=C.UTF-8 LANG=C.UTF-8

Old tweak (good to know, thanks @QuAzI https://github.com/nextcloud/docker/issues/721#issuecomment-616192895 Will try on my linuxserver.io dockerized NextCloud on ARM64 OpenWrt...

EDIT: Tested and fixed for me ! THANKS

erdoukki avatar Jun 12 '22 16:06 erdoukki

I have the same problem, but I cant fix it editing my env.

Here is my Compose:

version: '2'

volumes: nextcloud: db:

services: db: image: yobasystems/alpine-mariadb:latest restart: always command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW volumes: - db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=HerePassword - MYSQL_PASSWORD=HerePassword - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud

app: image: nextcloud restart: always ports: - 8080:80 links: - db volumes: - nextcloud:/var/www/html - /media/raid/nextcloud/:/var/www/html/data environment: - MYSQL_PASSWORD= - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_HOST=db

I dont know how to fix it, I have it in OMV6 running on a Raspberry Pi 4 and I already set the locale.gen to de_DE.UTF-8, also the intl_defaults in php.ini. Still not able to sync files with ä ö ü characters in it.

Zeroth42 avatar Jul 08 '23 10:07 Zeroth42