Bug 143818 - Talk doesn't handle input in UTF-8
Summary: Talk doesn't handle input in UTF-8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: talk
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-12-28 22:42 UTC by Miloslav Trmač
Modified: 2013-07-02 23:04 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-10 14:57:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Internationalize talk (5.13 KB, patch)
2005-01-08 19:18 UTC, Miloslav Trmač
no flags Details | Diff
Internationalize talk (5.13 KB, patch)
2005-01-08 19:21 UTC, Miloslav Trmač
no flags Details | Diff
The necessary spec changes, together with some cleanups. (1.48 KB, patch)
2005-01-08 19:23 UTC, Miloslav Trmač
no flags Details | Diff
The modified patch (5.27 KB, patch)
2005-01-10 09:35 UTC, Jindrich Novy
no flags Details | Diff

Description Miloslav Trmač 2004-12-28 22:42:36 UTC
Description of problem:
Entering non-ASCII data creates various display problems.

Version-Release number of selected component (if applicable):
talk-0.17-23

Comment 1 Miloslav Trmač 2004-12-28 22:43:14 UTC
On second thought, it doesn't handle even iso-8859-2.

Comment 2 Miloslav Trmač 2005-01-03 20:07:56 UTC
Please disregard comment #1. It was Christmas and I was
really paying attention to the talk going on rather than
talk behavior... ISO 8859-2 seems to work now.

Comment 3 Miloslav Trmač 2005-01-08 19:18:46 UTC
Created attachment 109517 [details]
Internationalize talk

Comment 4 Miloslav Trmač 2005-01-08 19:21:43 UTC
Created attachment 109518 [details]
Internationalize talk

The attached patch (just sent upstream) adds handling of multi-byte character
encodings (most importantly UTF-8) and double-width characters (for east-Asian
languages) to the talk client.

This involves:
- Separating s_columnpos (colun number) and s_typebufpos (strlen (s_typebuf))
- Adding code to find the last (possibly incomplete due to the byte-at-a-time
  input) character in s_typebuf, just before the terminating \0
- Decoding the multibyte character in display_addch () [if possible, e.g.
  it is not incomplete], getting its width, and using it for deciding whether
  to wrap the line
- Moving all bytes of an incomplete multibyte character to the next line when
  wrapping it to the next line
- Adding dorefresh () calls before every display_addch () because it needs
  the correct s_columnpos
- Using locale-specific data to determine which characters should be ^-escaped.

Comment 5 Miloslav Trmač 2005-01-08 19:23:27 UTC
Created attachment 109519 [details]
The necessary spec changes, together with some cleanups.

Comment 6 Jindrich Novy 2005-01-10 08:22:16 UTC
Hi, thanks for the patch. Any idea why we need position independent
code for talk on s390, s390x?

Comment 7 Miloslav Trmač 2005-01-10 09:08:23 UTC
We need it always (for PIE); it's just that -fpic puts
a limit on data size on some architectures and you have
to use -fPIC for those; apparently it is s390* here.
(I haven't tested whether -fPIC is really needed, I just
assume this was the reason.)

Comment 8 Jindrich Novy 2005-01-10 09:34:11 UTC
I modified these things:

- Removed redundant #define _GNU_SOURCE from the beginning of display.c
  since we use -D_GNU_SOURCE in CFLAGS. (added in spec)

- Removed redundant variable 'y' introduced by your patch. There's no 
  need to use getyx() as we have getcurx() when we're only interested in
  the x position.


Comment 9 Jindrich Novy 2005-01-10 09:35:01 UTC
Created attachment 109547 [details]
The modified patch


Note You need to log in before you can comment on or make changes to this bug.