[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-teseq] Re: bug in print_gxdm_info
From: |
Bruno Haible |
Subject: |
[Bug-teseq] Re: bug in print_gxdm_info |
Date: |
Sat, 23 Aug 2008 15:11:13 +0200 |
User-agent: |
KMail/1.5.4 |
Micah Cowan wrote:
> Thanks, Bruno. The following patch seems to have fixed this problem;
Thanks.
There is another bug in print_gxdm_info: When the final byte of the escape
sequence is 0x40..0x42, designations of G1..G3 are possible but are not
recognized by teseq.
Look at 042.pdf, 058.pdf, 087.pdf from the ISO-IR registry. They specify
the escape sequences
ESC 24 40..42 for designation into G0
ESC 24 29..2B 40..42 for designation into G1..G3
This is OK:
$ printf '\x1b\x24\x41\n' | teseq
: Esc $ A
& GZDM4: G0-DESIGNATE MULTIBYTE 94-SET
. LF/^J
but this is not OK:
$ printf '\x1b\x24\x29\x41\n' | teseq
: Esc $ ) A
. LF/^J
The attached patch fixes it, resulting in
$ printf '\x1b\x24\x29\x41\n' | teseq
: Esc $ ) A
& G1DM4: G1-DESIGNATE MULTIBYTE 94-SET
. LF/^J
2008-08-23 Bruno Haible <address@hidden>
* src/teseq.c (print_gxdm_info): Accept final byte 0x40..41 also with
i1 values different from 0 and 0x28.
*** teseq.c.v1 2008-08-23 14:50:59.000000000 +0200
--- teseq.c 2008-08-23 15:07:33.000000000 +0200
***************
*** 523,556 ****
}
}
! /* Identify multibyte graphical character set invocation. */
void
! print_gxdm_info (struct processor *p, int i1, int f)
{
int designate;
const char *desig_strs = "Z123";
int set;
! if (f == '\x40' || f == '\x41' || f == '\x42')
{
! if (i1 == 0)
! {
! designate = 0;
! set = 4;
! }
! else
! return;
}
else if (i1 >= 0x2d && i1 <= 0x2f)
{
set = 6;
designate = i1 - 0x2c;
}
- else if (i1 >= 0x28 && i1 != 0x2c)
- {
- set = 4;
- designate = i1 - 0x28;
- }
else
return;
--- 523,553 ----
}
}
! /* Identify multibyte graphical character set invocation.
! Escape sequence: ESC 0x24 [I1] FINAL */
void
! print_gxdm_info (struct processor *p, int i1, int final)
{
+ /* See ISO 2022 = ECMA 035, section 14.3.2. */
int designate;
const char *desig_strs = "Z123";
int set;
! if (i1 == (final == 0x40 || final == 0x41 || final == 0x42 ? 0 : 0x28))
{
! set = 4;
! designate = 0;
! }
! else if (i1 >= 0x29 && i1 <= 0x2b)
! {
! set = 4;
! designate = i1 - 0x28;
}
else if (i1 >= 0x2d && i1 <= 0x2f)
{
set = 6;
designate = i1 - 0x2c;
}
else
return;