skip to Main Content

When connecting to a docker instance on the command line using docker exec <container name> bash whenever I enter non-ascii characters such as ø, å or æ my command line freaks out and displays (arg: 8).

Docker will insist on escaping file names containing these characters when using ls.

Docker will however display the contents of files containing these characters without escaping.

How do I make docker consistently accept these characters on the command line without escaping?

2

Answers


  1. Chosen as BEST ANSWER

    I needed to set

      environment:
        - LC_ALL=C.UTF-8
    

    in docker-compose.yml


  2. First of all you need to set the locale inside the Docker container to support UTF-8 characters like this

    ENV LANG C.UTF-8
    

    and then rebuild the Docker image using the updated Dockerfile!

    docker build -t <YOUR_IMAGE> .
    

    now run new container using the updated image like below

    docker run -it <YOUR_IMAGE> bash
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search