Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
abb903fd
Commit
abb903fd
authored
Mar 13, 2006
by
Hye-Shik Chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1448490: Fix a bug that ISO-2022 codecs could not handle
SS2 (single-shift 2) escape sequences correctly.
parent
6058aa40
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
Lib/test/test_multibytecodec.py
Lib/test/test_multibytecodec.py
+7
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/cjkcodecs/_codecs_iso2022.c
Modules/cjkcodecs/_codecs_iso2022.c
+1
-1
No files found.
Lib/test/test_multibytecodec.py
View file @
abb903fd
...
...
@@ -75,9 +75,16 @@ class Test_StreamWriter(unittest.TestCase):
wr
.
write
(
'abcd'
)
self
.
assertEqual
(
s
.
getvalue
(),
'abcd'
)
class
Test_ISO2022
(
unittest
.
TestCase
):
def
test_g2
(
self
):
iso2022jp2
=
'
\
x1b
(B:hu4:unit
\
x1b
.A
\
x1b
Ni de famille'
uni
=
u':hu4:unit
\
xe9
de famille'
self
.
assertEqual
(
iso2022jp2
.
decode
(
'iso2022-jp-2'
),
uni
)
def
test_main
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
Test_StreamWriter
))
suite
.
addTest
(
unittest
.
makeSuite
(
Test_ISO2022
))
test_support
.
run_suite
(
suite
)
if
__name__
==
"__main__"
:
...
...
Misc/NEWS
View file @
abb903fd
...
...
@@ -279,6 +279,9 @@ Core and builtins
Extension
Modules
-----------------
-
Bug
#
1448490
:
Fixed
a
bug
that
ISO
-
2022
codecs
could
not
handle
SS2
(
single
-
shift
2
)
escape
sequences
correctly
.
-
The
unicodedata
module
was
updated
to
the
4.1
version
of
the
Unicode
database
.
The
3.2
version
is
still
available
as
unicodedata
.
db_3_2_0
for
applications
that
require
this
specific
version
(
such
as
IDNA
).
...
...
Modules/cjkcodecs/_codecs_iso2022.c
View file @
abb903fd
...
...
@@ -414,7 +414,7 @@ iso2022processg2(const void *config, MultibyteCodec_State *state,
(
*
inbuf
)
+=
3
;
*
inleft
-=
3
;
(
*
outbuf
)
+=
1
;
*
out
buf
-=
1
;
*
out
left
-=
1
;
return
0
;
}
...
...
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