Results 1 to 2 of 2

Thread: Terminal not displaying unicode characters correctly

  1. #1
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,342
    Distro
    Ubuntu

    Question Terminal not displaying unicode characters correctly

    I am having a serious problem on my Ubuntu 22.04, installed just 7 days ago. The thing is that I cannot reproduce this error on a VM installation of either 20.04 or 22.04, nor can other people on their machines.

    It's to do with Python not dealing with unicode characters.

    What I seem to have narrowed it down to is a symptom that my terminal (gnome-terminal) doesn't deal with unicode characters in file names or contents.

    Now, I don't know if this has any relation to the other problem, but I'd like to fix this anyway, and then see if makes a difference to my original problem.

    I have a file named borgé (note the unicode character). This is what happens in my terminal in the VM, where it works correctly:
    Code:
    $ ls -l
    -rw-rw-r-- 1 paddy paddy 10 Sep  4 13:02 borgé
    $ cat borgé   # Using tab to autocomplete the file name
    ...
    This is what happens on my main machine, where it doesn't work correctly. Note that, strangely, tab to autocomplete works fine.
    Code:
    $ ls -l-rw------- 1 paddy paddy 10 Sep  4 13:01 'borg'$'\303\251'
    $ cat borgé   # Using tab to autocomplete the file name
    ...
    The same is true in the console (Ctrl+Alt+F3); the VM works fine, and my main machine shows this strange output.

    As I say, this might have nothing to do with my original problem, but it would be nice to fix this to see if it makes a difference.

    More information:

    • I do not have an alias on ls
    • LANG=en_GB.UTF-8
    • LC_CTYPE=en_GB.UTF-8
    • LANGUAGE=en.UTF-8
    • I have run sudo select-default-wordlist and selected british-english.
    • Running dpkg-reconfigure -plow locales shows both en_GB.UTF-8 UTF-8 and en_US.UTF-8 UTF-8 marked.
    • I have run locale-gen en_GB.UTF-8 en_US.UTF-8.
    • I have run sudo update-locale LANG=en_GB.UTF-8 LANGUAGE=en.UTF-8

    Can you tell me what's going on, and what I can do to fix it, please?
    Last edited by Paddy Landau; September 4th, 2022 at 02:03 PM.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  2. #2
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,342
    Distro
    Ubuntu

    Re: Terminal not displaying unicode characters correctly

    … And I've just discovered the problem!

    I had LC_ALL=C. When I unset LC_ALL, my terminal works fine.

    Ugh.
    Last edited by Paddy Landau; September 4th, 2022 at 02:03 PM.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •