[SOLVED] Fonts in Ubuntu, locale issue?


Results 1 to 7 of 7

Thread: [SOLVED] Fonts in Ubuntu, locale issue?

  1. #1
    Join Date
    Feb 2000
    Location
    Scotland
    Posts
    1,163

    [SOLVED] Fonts in Ubuntu, locale issue?

    I'm confused as to why some characters aren't being displayed on my terminals. See:

    The confusing characters (which paste to "‘") I assume are quotation marks. However, I can type those directly into the terminal and they display properly...

    Fonts and locales and the like confuse the hell out of me. What's wrong with this setup, and what do I do to correct the fault?


    Cheers,
    S.

  2. #2
    Join Date
    Oct 2000
    Location
    Calgary, Alberta, Canada
    Posts
    8,116
    that looks like what happens on IRC when you have a certain Unicode charset on your system and someone types a message using a different Unicode charset.

    what distribution are you using? they all handle this type of thing slightly differently.

    here is a Unicode how-to for Gentoo - take a look and see if your system has similar files, settings then you can either fix it or revert to not using Unicode.

    http://gentoo-wiki.com/HOWTO_Make_yo..._unicode/utf-8

    PS: have you tried setting a different font for your terminal -- it is possible that the font is causing the problem... does this only happen in the terminal or in all apps?

  3. #3
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    What terminal, and which version? That looks vaguely like UTF-8; does this terminal support UTF-8 characters?

    What shell, and which version? The shell probably doesn't matter, but it might.

    What program is printing these characters, and which version?

    What are your LANG, LC_ALL, LC_MESSAGES, and LC_CTYPE shell variables set to, if anything?

    Need a bit more info...

  4. #4
    Join Date
    Feb 2000
    Location
    Scotland
    Posts
    1,163
    Quote Originally Posted by bwkaz
    Need a bit more info...
    The prior problem being knowing which information to provide for this issue


    Distribution: Ubuntu 5.10, 'Breezy Badger'
    Terminal: aterm 0.4.2 ('echo $TERM' reports rxvt)
    Program printing chars: gcc version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9), via GNU Make 3.80
    $LANG= en_GB.UTF-8
    $LC_ALL=
    $LC_MESSAGES=
    $LC_TYPE=

    I think that the problem now only happens in the terminal, though I did see quotation marks causing issue in Firefox previously (though that was the Ubuntu version of Firefox, not the official version from mozilla.org...).

    The font set *appears*, to my relative-layman's eyes, to be the standard terminal font (which I have never had issue with on any previous distribution).

    [At time of writing, the Gentoo link is down]
    Last edited by Stween; 12-17-2005 at 09:27 PM.

  5. #5
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Quote Originally Posted by Stween
    $LANG= en_GB.UTF-8
    Ah ha!

    I bet it's the UTF-8 part. I bet aterm can't handle UTF-8 characters: it's probably expecting either plain old 7-bit ASCII, or ISO-8859-X for some X. (Probably X=1; that gives the 7-bit ASCII character set, plus some Western European language characters.) Both of these character sets are one-byte-per-character, while UTF-8 is a multi-byte character set. So when aterm sees multiple bytes being printed from the program that's running (gcc), it will print the ASCII or ISO-8859-X character that corresponds to each byte, instead of composing them into one UTF-8 character like gcc intended it to do.

    (Note that the UTF-8, ISO-8859-X, and ASCII characters for all values 0-127 are the same, so normally you don't see any problem.)

    If you set LANG to either en_GB (using the default character set) or en_GB.iso8859-1 (using the Latin/Western European character set), does it fix the problem? If so, do you specifically need UTF-8 support in your console output?

  6. #6
    Join Date
    Feb 2000
    Location
    Scotland
    Posts
    1,163
    Quote Originally Posted by bwkaz
    If you set LANG to either en_GB (using the default character set) or en_GB.iso8859-1 (using the Latin/Western European character set), does it fix the problem? If so, do you specifically need UTF-8 support in your console output?
    Ah, cheers. Setting to simply en_GB fixes the problem. No, I don't specifically need UTF-8 support in my console, I was simply running with what Ubuntu defaulted to. Normally default font settings don't bother me, hence my inexperience in this area

  7. #7
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Hmm... It's actually not a font thing, it's a character set thing.

    The character set is what determines which "character" (actually "code point") goes with each byte value (or set of byte values). The font is what determines what each character (code point) actually looks like on the screen.

    It looked more like aterm was choosing the wrong code point for the UTF-8 bytes, not that the font was choosing the wrong visual representation for each character. (This appeared to be the case because of the multiple characters being shown where only one should appear -- that's a classic instance of UTF-8 being interpreted as a sequence of single-byte characters.) Which made me suspect LANG/LC_ALL/etc.

    But anyway, whatever. It's working now.

Posting Permissions

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