Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vte
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
42
Issues
42
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
GNOME
vte
Commits
da28e900
Commit
da28e900
authored
Oct 28, 2018
by
Christian Persch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parser: charset: Add a DEC private OCS
parent
05d7324a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
11 deletions
+36
-11
parser-charset-tables.hh
src/parser-charset-tables.hh
+10
-2
parser-charset.hh
src/parser-charset.hh
+1
-0
parser-test.cc
src/parser-test.cc
+11
-5
parser.cc
src/parser.cc
+14
-4
No files found.
src/parser-charset-tables.hh
View file @
da28e900
...
...
@@ -207,7 +207,7 @@ static uint8_t const charset_control_single[] = {
/* Non-ISO-2022 coding systems, with standard return:
* ESC 2/5 F
*/
static
uint8_t
const
charset_ocs
_with_return
[]
=
{
static
uint8_t
const
charset_ocs
[]
=
{
/* 3/0..3/15 */
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
NA
,
DEC
(
IBM_PROPRINTER
),
NA
,
NA
,
...
...
@@ -216,10 +216,18 @@ static uint8_t const charset_ocs_with_return[] = {
IR
(
188
)
};
/* Non-ISO-2022 coding systems, with standard return:
* ESC 2/5 SP F
*/
static
uint8_t
const
charset_ocs_with_2_0
[]
=
{
/* 03/00 */
DEC
(
BARCODE
)
};
/* Non-ISO-2022 coding systems, without standard return:
* ESC 2/5 2/15 F
*/
static
uint8_t
const
charset_ocs_with
out_return
[]
=
{
static
uint8_t
const
charset_ocs_with
_2_15
[]
=
{
/* 4/0..4/12 */
IR
(
162
),
IR
(
163
),
IR
(
125
),
IR
(
174
),
IR
(
175
),
IR
(
176
),
IR
(
177
),
IR
(
190
),
IR
(
191
),
IR
(
192
),
IR
(
193
),
IR
(
194
),
IR
(
195
)
...
...
src/parser-charset.hh
View file @
da28e900
...
...
@@ -298,6 +298,7 @@ ALIAS(SUPPLEMENTAL_NAME(LATIN_CYRILLIC), IR_NAME(144))
/* Other coding systems */
DEC
(
IBM_PROPRINTER
)
/* DEC PPLV2; ESC 2/5 3/13 */
DEC
(
BARCODE
)
/* DEC PPLV2; ESC 2/5 2/0 3/0 */
#undef IR_NAME
#undef DEC_NAME
...
...
src/parser-test.cc
View file @
da28e900
...
...
@@ -573,17 +573,23 @@ test_seq_esc_charset_other(void)
{
uint32_t
i
[
4
];
/* Other coding systems: ESC 2/5 F or ESC 2/5
2/15
F */
/* Other coding systems: ESC 2/5 F or ESC 2/5
I
F */
i
[
0
]
=
0x25
;
test_seq_esc_charset
(
i
,
1
,
charset_ocs_with_return
,
G_N_ELEMENTS
(
charset_ocs_with_return
),
charset_ocs
,
G_N_ELEMENTS
(
charset_ocs
),
0x30
,
VTE_CMD_DOCS
,
VTE_CHARSET_NONE
,
0
);
i
[
1
]
=
0x20
;
test_seq_esc_charset
(
i
,
2
,
charset_ocs_with_2_0
,
G_N_ELEMENTS
(
charset_ocs_with_2_0
),
0x30
,
VTE_CMD_DOCS
,
VTE_CHARSET_NONE
,
0
);
i
[
1
]
=
0x2f
;
test_seq_esc_charset
(
i
,
2
,
charset_ocs_with
out_return
,
G_N_ELEMENTS
(
charset_ocs_with
out_return
),
charset_ocs_with
_2_15
,
G_N_ELEMENTS
(
charset_ocs_with
_2_15
),
0x40
,
VTE_CMD_DOCS
,
VTE_CHARSET_NONE
,
0
);
}
...
...
src/parser.cc
View file @
da28e900
...
...
@@ -253,14 +253,24 @@ static unsigned int vte_parse_charset_ocs(uint32_t raw,
switch
(
VTE_SEQ_INTERMEDIATE
(
intermediates
))
{
case
VTE_SEQ_INTERMEDIATE_NONE
:
/* OCS with standard return */
if
(
remaining_intermediates
==
0
&&
raw
>=
0x30
&&
raw
<
(
0x30
+
G_N_ELEMENTS
(
charset_ocs_with_return
)))
return
charset_ocs_with_return
[
raw
-
0x30
];
raw
>=
0x30
&&
raw
<
(
0x30
+
G_N_ELEMENTS
(
charset_ocs
)))
return
charset_ocs
[
raw
-
0x30
];
break
;
case
VTE_SEQ_INTERMEDIATE_SPACE
:
/* OCS with standard return */
if
(
remaining_intermediates
==
0
&&
raw
>=
0x30
&&
raw
<
(
0x30
+
G_N_ELEMENTS
(
charset_ocs_with_2_0
)))
return
charset_ocs_with_2_0
[
raw
-
0x30
];
/* Or should this return VTE_CHARSET_DRCS; ? */
break
;
case
VTE_SEQ_INTERMEDIATE_BANG
...
VTE_SEQ_INTERMEDIATE_DOT
:
/* OCS with standard return */
break
;
case
VTE_SEQ_INTERMEDIATE_SLASH
:
/* OCS without standard return */
if
(
remaining_intermediates
==
0
&&
raw
>=
0x40
&&
raw
<
(
0x40
+
G_N_ELEMENTS
(
charset_ocs_with
out_return
)))
return
charset_ocs_with
out_return
[
raw
-
0x40
];
raw
>=
0x40
&&
raw
<
(
0x40
+
G_N_ELEMENTS
(
charset_ocs_with
_2_15
)))
return
charset_ocs_with
_2_15
[
raw
-
0x40
];
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment