Professional Web Applications Themes

Terminal mutating l/ and o/ - Mac Programming

Howdy. A few days ago (POSSIBLY in conjunction with the Security upgrade) my Terminal started, for output data, when you type an O or an L followed by a slash, showing a single character, a slashed L used for the "W" sound in Polish (or russian I guess) or a slashed O. So for example, anytime I type cd daniel/ it echoes the last TWO characters as an ell with a slash through it. "o" does exactly the same thing. Input is OK - the above example will change me into a directory called "daniel" -- it's just the display ...

  1. #1

    Default Terminal mutating l/ and o/

    Howdy.

    A few days ago (POSSIBLY in conjunction with the Security upgrade) my
    Terminal started, for output data, when you type an O or an L followed
    by a slash, showing a single character, a slashed L used for the "W"
    sound in Polish (or russian I guess) or a slashed O. So for example,
    anytime I type

    cd daniel/

    it echoes the last TWO characters as an ell with a slash through it.
    "o" does exactly the same thing.

    Input is OK - the above example will change me into a directory called
    "daniel" -- it's just the display that's mixed up.

    Opening Inspector and changing Display/Character Set Encoding seems to
    have no effect at all, nor did deleting
    ~/Library/Preferences/com.apple.Terminal.plist, testing, and then
    changing Display/Character Set Encoding.

    Other apps are not doing this.

    Any hints or suggestions would be most welcome. <Reply> by email would
    be great. Thanks very much.

    --
    Daniel MacKay
    Halifax, Nova Scotia, Canada
    Daniel Guest

  2. #2

    Default Re: Terminal mutating l/ and o/

    In article <uunet.ca>,
    Daniel MacKay <ca> wrote:
     

    I ran into this a while back. It wasn't the exact same thing, but it was
    similar. I don't recall the exact character sets, but I think mine was
    creating ligatures, where character combinations like 'fi' get merged
    into one character. Anyway, I solved the problem by switching fonts.
    Monaco has too many troubles with Terminal anyway; switching to VT100
    solved my problem.
    Michael Guest

  3. #3

    Default Re: Terminal mutating l/ and o/

    Michael Ash wrote: 

    What font were you (Daniel) using? I need a
    monospace font where Terminal knows how to render
    the Polish characters? I tried both Monaco and Courier,
    but the slashed L and some others are ? in both,
    e.g., Łańcut, Żołynia. Both these words are displayed
    correctly with Courier in Mozilla and Textedit.

    I can't find VT100 in the font panel.

    --
    Wes Groleau
    "Would the prodigal have gone home if
    the elder brother was running the farm?"
    -- James Jordan

    Wes Guest

  4. #4

    Default Re: Terminal mutating l/ and o/

    In article <uunet.ca>,
    Daniel MacKay <ca> wrote:
     

    The problem is that the font you're using is set up to automatically
    form ligatures with those letter combinations. Since Cocoa now uses ATS
    (and in particular, line layout) by default, and since Terminal uses
    Cocoa text rendering, if the font has the 'mort' table then the
    ligatures will form. So the quickest fix is to switch to a different
    font.

    A slightly more involved fix is to find the font you're using, move it
    temporarily to the desktop (so you can edit it), and open it with
    TrueEdit, which is available for free at developer.apple.com/fonts.
    Delete the 'mort' and 'feat' tables, save, and then put the font back
    into your fonts folder. The problem will be gone.

    The font was likely run through an old version of the AAT Font Tool (or
    its predecessor, the GXifier) at some point. This behavior used to be
    installed as a default; more recent versions of the tool no longer do
    this.

    Dave Opstad
    Line Layout Weenie (ret.)
    David Guest

  5. #5

    Default Re: Terminal mutating l/ and o/

    David Opstad wrote:
     
    >
    > The problem is that the font you're using is set up to automatically
    > form ligatures with those letter combinations. Since Cocoa now uses ATS[/ref]

    While these may be convenient shortcuts for
    typing Polish, it was a bit bogus for someone
    to put them into a table of ligatures.

    It's also a bit bogus for terminal to NOT display
    these same characters when set to UTF-8, reading
    a UTF-8 file, and using a font that _does_ contain
    the characters.

    Oh, well, it could be worse....

    --
    Wes Groleau
    When all you have is a perl, everything looks like a string.

    Wes Guest

  6. #6

    Default Re: Terminal mutating l/ and o/

    In article <com>,
    Wes Groleau <org> wrote:
     

    Monaco. When I switched to Monaco CY the "problem" went away.

    Thanks for your help, everyone!
    --
    Daniel MacKay
    Halifax, Nova Scotia, Canada
    Daniel Guest

  7. #7

    Default Re: Terminal mutating l/ and o/

    In article <com>,
    Wes Groleau <org> wrote:
     

    As a historical note: this was done originally before Unicode was widely
    known or used (early 1990s), specifically to allow access to the 32
    glyphs defined in the original Apple TrueType spec but inaccessible from
    the Mac Roman encoding.

    In a Unicode world, you're right, of course; there's no substitute for
    using the correct character code.

    But
    David Guest

  8. #8

    Default Re: Terminal mutating l/ and o/

    Wes Groleau <org> wrote:
     

    Terminal doesn't read files. The program you're using needs to work with
    utf-8 in order for utf-8 display to work properly in Terminal.

    --
    Jeremy | com
    Jeremy Guest

  9. #9

    Default Re: Terminal mutating l/ and o/

    Jeremy Nixon wrote: 
    >
    > Terminal doesn't read files. The program you're using needs to work with
    > utf-8 in order for utf-8 display to work properly in Terminal.[/ref]

    OK, _displaying_ a UTF-8 file. The program was 'cat'

    --
    Wes Groleau
    -----------
    Daily Hoax: http://www.snopes2.com/cgi-bin/random/random.asp

    Wes Guest

  10. #10

    Default Re: Terminal mutating l/ and o/

    Wes Groleau wrote:
     [/ref]

    >
    > OK, _displaying_ a UTF-8 file. The program was 'cat'[/ref]

    Did some more experimenting with the text

    ?an'cut, Z.o?ynia, Chtigny

    cut from Textedit

    If I do

    echo "

    and then paste the text and then

    " > temp

    One hears the BEL and sees

    [localhost:~] wgroleau% echo "a
    [localhost:~] wgroleau% echo "acut, oynia, Chtigny" > temp

    'od -xc temp' shows that exactly what is seen gets in the file.

    cat > temp
    ?an'cut, Z.o?ynia, Chtigny
    ^D

    (middle line pasted)
    shows it just like that and gets
    exactly the intended characters (UTF-8
    encoding) in the file.

    rm temp; vi temp
    i?an'cut, Z.o?ynia, Chtigny:wq

    gets the same thing, and is displayed the way vi likes
    to display non-ASCII characters.

    It would really be nice to be able to use
    Unicode in scripts, echo commands, 'vi' and
    see the characters instead of the codes.

    Even seeing the codes, though, is better than
    seeing and getting garbage.

    I've gotten pretty good at entering hiragana
    with the hiragana keyboard and kanji with Unicode Hex Input.
    Most Mac and Windows browsers correctly render my Polish
    and my "printer's quotes," em-dashes, ellipses, section
    symbols and such, and many of them correctly render my Japanese.

    But now I need to do some programming and perl stuff.
    To do text in textedit and then paste into Terminal
    would be a proctalgia. To have to learn to manually
    encode UTF-8 instead would be worse (and probably still
    wouldn't work sometimes).

    --
    Wes Groleau
    Alive and Well
    http://freepages.religions.rootsweb.com/~wgroleau/

    Wes Guest

  11. #11

    Default Re: Terminal mutating l/ and o/

    Wes Groleau <org> wrote:
     

    Your message was tagged as iso-8859-1, which evidently can't display
    whatever that is (and so it got the ?s in it), so I can't really try to
    duplicate your result, but I can try with random utf-8.

    Using utf-8 at the shell is going to be hit-or-miss; some programs will
    handle it, others will not. Many of the ones that will, will only do it
    because they are looking at the input as a raw bytestream, which really
    means the success will be a coincidence.

    It will also depend on your shell. I can enter an echo command with utf-8
    and have it echoed back properly, in zsh, which is my usual shell.
    Switching to either tcsh or bash results in it failing. However, even in
    zsh, using a double-byte character gets the shell's command line editing
    confused as to cursor position. The shells basically just don't do utf-8
    yet.

    That won't be your only hurdle, though. Some of the text-processing
    stuff won't understand utf-8 yet, certainly. I was able to get "grep" to
    match a utf-8 character, but I bet it was just matching the bytestream.
     

    It would be, yes, but I think you're in for a lot of frustration if you
    try to do it at this point. Best to stick to a GUI editor that does
    Unicode (BBEdit is okay for that) and make sure whatever you're using
    also does utf-8.
     

    Perl *does* handle utf-8. You'll want at least version 5.8.0, though
    I'd recommend 5.8.2. OS X 10.3 comes with 5.8.1, which should be okay.

    You can have utf-8 directly in your Perl code, even as variable names,
    if you put "use utf8;" at the top of the script. I've used utf-8 in
    string literals; I haven't yet had the nerve to use it in variable
    names or identifiers, though the obfuscation possibilities are quite
    interesting. :)

    You can also, of course, process utf-8 input and output. For more
    information type "perldoc perlunicode" at the shell.
     

    You can directly edit the file in a GUI editor. There is no need to
    use a terminal-based editor if you don't want to. I make much of my
    living coding in Perl, and I'm using either BBEdit or Xcode to do my
    editing.

    --
    Jeremy | com
    Jeremy Guest

  12. #12

    Default Re: Terminal mutating l/ and o/

    Jeremy Nixon wrote: 
    >
    > Your message was tagged as iso-8859-1, which evidently can't display[/ref]

    !#$%! I _told_ Mozilla to use UTF-8 ! Grrr.
     

    Guess I'll shift to zsh then ...
     

    .... or maybe not. :-)
     
    >
    > It would be, yes, but I think you're in for a lot of frustration if you
    > try to do it at this point. Best to stick to a GUI editor that does
    > Unicode (BBEdit is okay for that) and make sure whatever you're using[/ref]

    I used to use BBEdit, until I decided to shift to the
    latest version. Now it crashes on launch. And reinstalling
    the older version did not fix it. So now, it's TextEdit, which
    although primitive in functionality, DOES correctly display
    and input the characters.
     

    That's good to hear. I expect 10.3 to be delivered today.
    I looked at installing perl 5.8 but did not have DevTools
    at the time.
     

    That's what I'm doing now, but when scripting,
    it would be nice to work in one window instead of
    edit here, change focus, and run it. Especially when
    doing one-liners interactively.

    " !#$ Didn't work! Wait, did I save my changes?" :-)

    (Did somebody say emacs?)

    Thanks for your tips, though, the snips were helpful, too.

    --
    Wes Groleau
    http://groleau.freeshell.org

    Wes Guest

  13. #13

    Default Re: Terminal mutating l/ and o/

    In comp.sys.mac.programmer.help, Wes Groleau <org> wrote: 

    I would guess that deleting the BBEdit preference file would fix this
    problem for the older version, and maybe for the latest version also.
    (Or "all the BBEdit preference files" -- I can't remember if there's
    more than one. I think there is.)

    --Z

    "And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
    *
    * Make your vote count. Get your vote counted.
    Andrew Guest

  14. #14

    Default Re: Terminal mutating l/ and o/

    Wes Groleau <org> wrote:
     

    Well, I'm using the latest version too, and it doesn't do that, so it's
    not a "feature" of that version. :) Try ing away the prefs. Indeed,
    I'm typing this post in BBEdit, which I use as my editor for my mail and
    news clients.
     
    >
    > That's what I'm doing now, but when scripting,
    > it would be nice to work in one window instead of
    > edit here, change focus, and run it.[/ref]

    It's a workflow thing... once you do enough coding you'll come up with
    something that works for you. I find that way easier than exiting the
    editor to get back to a shell every time I make a change. But everyone
    has their own way, and all of them are right. :)

    --
    Jeremy | com
    Jeremy Guest

Similar Threads

  1. which container for a terminal like app?
    By agelanyi in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: June 6th, 07:32 PM
  2. Replies: 0
    Last Post: July 1st, 02:04 PM
  3. Replies: 7
    Last Post: November 4th, 07:27 PM
  4. Terminal Emulation
    By MIKE in forum AIX
    Replies: 5
    Last Post: October 10th, 08:55 PM
  5. Terminal
    By MS in forum Mac Applications & Software
    Replies: 5
    Last Post: July 10th, 02:30 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139