UTF8 character which consists of more bytes is displayed on
terminal (phterm) as sets of individual characters corresponding
to the bytes. Of course, terminal can display limited set of characters
but it is able to use a given character code set, as LATIN II
in my case. Isn’t it possible to convert UTF8 to a given coding
outside application program so that the program writes UTF8
characters, but the converted characters are displayed on the
terminal screen ?
UTF8 character which consists of more bytes is displayed on
terminal (phterm) as sets of individual characters corresponding
to the bytes. Of course, terminal can display limited set of characters
but it is able to use a given character code set, as LATIN II
in my case. Isn’t it possible to convert UTF8 to a given coding
outside application program so that the program writes UTF8
characters, but the converted characters are displayed on the
terminal screen ?
UTF8 character which consists of more bytes is displayed on
terminal (phterm) as sets of individual characters corresponding
to the bytes. Of course, terminal can display limited set of characters
One reason why pterm doesn’t work with UTF-8 is because some of the
bytes that UTF-8 uses to encode characters are considered control
characters by the ANSI terminal protocol. Another, bigger reason is
that very few programs know how to handle a UTF-8 terminal – and
there’s no standard way under QNX to tell a program that your terminal
works with multibyte characters. Our Dev, the shell, and all the text
editors we ship tend to assume that writing a byte to the terminal
moves the cursor by one position, and that a backspace should delete one byte from the line buffer, and so on.
but it is able to use a given character code set, as LATIN II
in my case. Isn’t it possible to convert UTF8 to a given coding
outside application program so that the program writes UTF8
characters, but the converted characters are displayed on the
terminal screen ?
Sure you can do that outside of your program – for instance, by running
your program on a pseudo-tty controlled by another program doing the
conversion. There’s a common Unix utility called “script” that uses a
pseudo-tty to catch all the terminal output and log it in a file; I
imagine you should be able to find its source on the Web, and then it
shouldn’t be too difficult to modify it to do the conversion instead of
the logging. Of course, how well this will work with your application
depends on whether your application tries to do any of the stuff that
breaks other applications when you run them on a UTF terminal…