Results 1 to 9 of 9

Thread: Bash - UTF8

  1. #1
    Join Date
    Mar 2013
    Beans
    5

    Bash - UTF8

    Hi guys,

    I'm using the Ubuntu Linux Server und working with the Bash. The problem is, that the bash doesn't print UTF-characters. This doesn't work:
    echo -e "\xE2\x98\xA0"

    I don't know why. Can anyone please help me?

  2. #2
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Bash - UTF8

    With pleasure.
    Code:
    echo $'\uE2\u98\uA0'
    or
    Code:
    echo -e '\uE2\u98\uA0'

  3. #3
    Join Date
    Mar 2013
    Beans
    5

    Re: Bash - UTF8

    That doesn't work. The bash doesn't print the unicode char.

  4. #4
    Join Date
    Apr 2012
    Beans
    6,526

    Re: Bash - UTF8

    Isn't it determined by the terminal rather than the shell? for the server console, you could try

    Code:
    sudo dpkg-reconfigure console-setup
    and making sure UTF-8 and the appropriate character set are selected (I don't know what charset those characters are from)

  5. #5
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Bash - UTF8

    Excuse me, what Unicode character are you trying to print? The commands above should have printed three of them:
    U+00E2 â, latin small letter a with circumflex
    U+0098 SOS, start of string
    U+00A0 NBSP, non-breaking space

  6. #6
    Join Date
    Mar 2013
    Beans
    5

    Re: Bash - UTF8

    Well I'm using the German language "de_DE.UTF-8". Doesn't that mean that i Can print every possible unicode character which exists?

  7. #7
    Join Date
    Mar 2013
    Beans
    5

    Re: Bash - UTF8

    Quote Originally Posted by schragge View Post
    Excuse me, what Unicode character are you trying to print? The commands above should have printed three of them:
    U+00E2 â, latin small letter a with circumflex
    U+0098 SOS, start of string
    U+00A0 NBSP, non-breaking space
    It only prints a diamond.

  8. #8
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Bash - UTF8

    First, you need a Unicode-capable terminal emulator, obviously. Second, your console font should include glyphs for the characters you're trying to print. If you're doing it over ssh from a PuTTY on Windows, note that PuTTY is configured for Latin-1 charset by default, and you should change it to UTF-8 in the settings.

  9. #9
    Join Date
    Mar 2013
    Beans
    5

    Re: Bash - UTF8

    No I'm using the Ubuntu Server with bash. Many Unicode characters aren't printed. A diamond is printed instead. So what do I have to do to solve this problem?

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
  •