Skip to content

Commit 20f3973

Browse files
committed
Use symbols ⩽ ⩾ for GOST 0116, 0117.
1 parent 7b63485 commit 20f3973

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

encoding.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static const unsigned short gost_to_unicode_cyr[256] = {
4343
/* 060-067 */ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
4444
/* 070-077 */ 0x0428, 0x0429, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x44,
4545
/* 100-107 */ 0x46, 0x47, 0x49, 0x4a, 0x4c, 0x4e, 0x51, 0x52,
46-
/* 110-117 */ 0x53, 0x55, 0x56, 0x57, 0x5a, 0x203e, 0x2264, 0x2265,
46+
/* 110-117 */ 0x53, 0x55, 0x56, 0x57, 0x5a, 0x203e, 0x2a7d, 0x2a7e,
4747
/* 120-127 */ 0x2228, 0x2227, 0x2283, 0xac, 0xf7, 0x2261, 0x25, 0x25c7,
4848
/* 130-137 */ 0x7c, 0x2015, 0x5f, 0x21, 0x22, 0x042a, 0xb0, 0x2032,
4949
};
@@ -58,7 +58,7 @@ static const unsigned short gost_to_unicode_lat[256] = {
5858
/* 060-067 */ 0x50, 0x43, 0x54, 0x59, 0x0424, 0x58, 0x0426, 0x0427,
5959
/* 070-077 */ 0x0428, 0x0429, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x44,
6060
/* 100-107 */ 0x46, 0x47, 0x49, 0x4a, 0x4c, 0x4e, 0x51, 0x52,
61-
/* 110-117 */ 0x53, 0x55, 0x56, 0x57, 0x5a, 0x203e, 0x2264, 0x2265,
61+
/* 110-117 */ 0x53, 0x55, 0x56, 0x57, 0x5a, 0x203e, 0x2a7d, 0x2a7e,
6262
/* 120-127 */ 0x2228, 0x2227, 0x2283, 0xac, 0xf7, 0x2261, 0x25, 0x25c7,
6363
/* 130-137 */ 0x7c, 0x2015, 0x5f, 0x21, 0x22, 0x042a, 0xb0, 0x2032,
6464
};
@@ -192,7 +192,7 @@ unsigned char unicode_to_koi7(unsigned short val)
192192
/* `abcdefg */ 0, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, // ABCDEFG
193193
/* hijklmno */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, // HIJKLMNO
194194
/* pqrstuvw */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, // PQRSTUVW
195-
/* xyz{|}~ */ 0x58, 0x59, 0x5a, 0x0e, 0x5e, 0x0f, 0x1f, 0, // XYZ≤|≥¬
195+
/* xyz{|}~ */ 0x58, 0x59, 0x5a, 0x0e, 0x5e, 0x0f, 0x1f, 0, // XYZ⩽|⩾¬
196196
/* 80 - 87 */ 0, 0, 0, 0, 0, 0, 0, 0,
197197
/* 88 - 8f */ 0, 0, 0, 0, 0, 0, 0, 0,
198198
/* 90 - 97 */ 0, 0, 0, 0, 0, 0, 0, 0,
@@ -420,6 +420,14 @@ unsigned char unicode_to_koi7(unsigned short val)
420420
return '$';
421421
}
422422
break;
423+
case 0x2a:
424+
switch ((unsigned char)val) {
425+
case 0x7d:
426+
return '\16'; //
427+
case 0x7e:
428+
return '\17'; //
429+
}
430+
break;
423431
}
424432
return 0;
425433
}
@@ -673,7 +681,7 @@ const unsigned char text_to_gost[64] = {
673681
const unsigned short koi7_to_unicode[128] = {
674682
// clang-format off
675683
/* Ъ× */ 0, 0x01, 0x02, 0x03, 0x04, 0x042a, 0x06, 0xd7,
676-
/* ≤≥ */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x2264, 0x2265,
684+
/* ⩽⩾ */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x2a7d, 0x2a7e,
677685
/* ‘ ―↑⏨ */ 0x2018, 0x11, 0x12, 0x13, 0x14, 0x2015, 0x2191, 0x23e8,
678686
/* ≠°÷’⊃≡∨¬ */ 0x2260, 0xb0, 0xf7, 0x2019, 0x2283, 0x2261, 0x2228, 0xac,
679687
/* !"#$%&' */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,

gost10859.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
#define GOST_W 0113 // W
101101
#define GOST_Z 0114 // Z
102102
#define GOST_OVERLINE 0115 // ^
103-
#define GOST_LESS_THAN_OR_EQUAL 0116 //
104-
#define GOST_GREATER_THAN_OR_EQUAL 0117 //
103+
#define GOST_LESS_THAN_OR_EQUAL 0116 //
104+
#define GOST_GREATER_THAN_OR_EQUAL 0117 //
105105
#define GOST_LOGICAL_OR 0120 // v
106106
#define GOST_LOGICAL_AND 0121 // &
107107
#define GOST_IMPLICATION 0122 // ?

tests/cosy_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ TEST(unit, utf8_to_koi7)
158158
EXPECT_EQ(utf8_to_koi7("×", 1), "\6");
159159
EXPECT_EQ(utf8_to_koi7("", 1), "\16");
160160
EXPECT_EQ(utf8_to_koi7("", 1), "\17");
161+
EXPECT_EQ(utf8_to_koi7("", 1), "\16");
162+
EXPECT_EQ(utf8_to_koi7("", 1), "\17");
161163
EXPECT_EQ(utf8_to_koi7("", 1), "\20");
162164
EXPECT_EQ(utf8_to_koi7("", 1), "\25");
163165
EXPECT_EQ(utf8_to_koi7("", 1), "\26"); // was @

tests/session_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ _).
938938
*end file
939939
)");
940940
const std::string expect = R"(*EXECUTE
941-
Ъ×≤≥
941+
Ъ×⩽⩾
942942
‘―↑⏨
943943
≠°÷’
944944
⊃≡∨¬

0 commit comments

Comments
 (0)