diff options
Diffstat (limited to 'iconvdata/ibm933.c')
-rw-r--r-- | iconvdata/ibm933.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/iconvdata/ibm933.c b/iconvdata/ibm933.c index d1f3f05296..669e357066 100644 --- a/iconvdata/ibm933.c +++ b/iconvdata/ibm933.c @@ -1,5 +1,5 @@ /* Conversion from and to IBM933. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Masahide Washizawa <washi@yamato.ibm.co.jp>, 2000. @@ -17,6 +17,10 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +/* IBM933 is designed for the representation of Korean using a stateful + EBCDIC encoding scheme. It is also known as CCSID 933 or CP933. See: + https://www-01.ibm.com/software/globalization/ccsid/ccsid933.html */ + #include <dlfcn.h> #include <stdint.h> #include <wchar.h> @@ -104,24 +108,14 @@ enum \ if (__builtin_expect (ch, 0) == SO) \ { \ - /* Shift OUT, change to DBCS converter. */ \ - if (curcs == db) \ - { \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ - } \ + /* Shift OUT, change to DBCS converter (redundant escape okay). */ \ curcs = db; \ ++inptr; \ continue; \ } \ else if (__builtin_expect (ch, 0) == SI) \ { \ - /* Shift IN, change to SBCS converter. */ \ - if (curcs == sb) \ - { \ - result = __GCONV_ILLEGAL_INPUT; \ - break; \ - } \ + /* Shift IN, change to SBCS converter (redundant escape okay). */ \ curcs = sb; \ ++inptr; \ continue; \ @@ -255,6 +249,7 @@ enum break; \ } \ *outptr++ = SI; \ + curcs = sb; \ } \ \ if (__glibc_unlikely (outptr + 1 > outend)) \ @@ -263,7 +258,6 @@ enum break; \ } \ *outptr++ = cp[0]; \ - curcs = sb; \ } \ \ /* Now that we wrote the output increment the input pointer. */ \ |