2014-05-28 23:18:47 +00:00
|
|
|
--- a/src/locale/iconv.c
|
|
|
|
+++ b/src/locale/iconv.c
|
2018-02-22 22:54:04 +00:00
|
|
|
@@ -48,6 +48,7 @@ static const unsigned char charmaps[] =
|
|
|
|
"utf16\0\0\312"
|
|
|
|
"ucs4\0utf32\0\0\313"
|
|
|
|
"ucs2\0\0\314"
|
2014-05-28 23:18:47 +00:00
|
|
|
+#ifdef FULL_ICONV
|
|
|
|
"eucjp\0\0\320"
|
2024-03-01 20:51:25 +00:00
|
|
|
"shiftjis\0sjis\0cp932\0\0\321"
|
2017-11-19 16:19:23 +00:00
|
|
|
"iso2022jp\0\0\322"
|
2018-02-22 22:54:04 +00:00
|
|
|
@@ -56,6 +57,7 @@ static const unsigned char charmaps[] =
|
2014-05-28 23:18:47 +00:00
|
|
|
"gb2312\0\0\332"
|
|
|
|
"big5\0bigfive\0cp950\0big5hkscs\0\0\340"
|
|
|
|
"euckr\0ksc5601\0ksx1001\0cp949\0\0\350"
|
|
|
|
+#endif
|
|
|
|
#include "codepages.h"
|
|
|
|
;
|
|
|
|
|
2018-02-22 22:54:04 +00:00
|
|
|
@@ -66,6 +68,7 @@ static const unsigned short legacy_chars
|
2014-05-28 23:18:47 +00:00
|
|
|
#include "legacychars.h"
|
|
|
|
};
|
|
|
|
|
|
|
|
+#ifdef FULL_ICONV
|
|
|
|
static const unsigned short jis0208[84][94] = {
|
|
|
|
#include "jis0208.h"
|
|
|
|
};
|
2018-02-22 22:54:04 +00:00
|
|
|
@@ -85,6 +88,7 @@ static const unsigned short hkscs[] = {
|
2014-05-28 23:18:47 +00:00
|
|
|
static const unsigned short ksc[93][94] = {
|
|
|
|
#include "ksc.h"
|
|
|
|
};
|
|
|
|
+#endif
|
|
|
|
|
2017-11-19 16:19:23 +00:00
|
|
|
static const unsigned short rev_jis[] = {
|
|
|
|
#include "revjis.h"
|
2018-02-22 22:54:04 +00:00
|
|
|
@@ -205,6 +209,7 @@ static unsigned legacy_map(const unsigne
|
2017-11-19 16:19:23 +00:00
|
|
|
return x < 256 ? x : legacy_chars[x-256];
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef FULL_ICONV
|
|
|
|
static unsigned uni_to_jis(unsigned c)
|
|
|
|
{
|
|
|
|
unsigned nel = sizeof rev_jis / sizeof *rev_jis;
|
2018-02-22 22:54:04 +00:00
|
|
|
@@ -223,6 +228,7 @@ static unsigned uni_to_jis(unsigned c)
|
2017-11-19 16:19:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb)
|
2014-05-28 23:18:47 +00:00
|
|
|
{
|
2018-02-22 22:54:04 +00:00
|
|
|
@@ -319,6 +325,7 @@ size_t iconv(iconv_t cd, char **restrict
|
2014-05-28 23:18:47 +00:00
|
|
|
}
|
2018-02-22 22:54:04 +00:00
|
|
|
type = scd->state;
|
|
|
|
continue;
|
2014-05-28 23:18:47 +00:00
|
|
|
+#ifdef FULL_ICONV
|
|
|
|
case SHIFT_JIS:
|
2017-11-19 16:19:23 +00:00
|
|
|
if (c < 128) break;
|
2014-05-28 23:18:47 +00:00
|
|
|
if (c-0xa1 <= 0xdf-0xa1) {
|
toolchain/musl: update to version 1.1.20
This release introduces the ability to replace/interpose the allocator
(malloc) subject to certain restrictions, adds an experimental m68k
port, and makes notable improvements to stdio (application-provided
buffers), getaddrinfo (AI_ADDRCONFIG, support for IPv4-only kernel
configurations), the dynamic linker (safety against dlopen of
libraries using initial-exec TLS model, reclaiming unused memory on
FDPIC archs, better dladdr results), and handling of default thread
stack size (pthread_setattr_default_np now works more reliably).
Many bugs have been fixed, including potentially dangerous regressions
in iconv (only for new conversions to legacy encodings) and visibly
incorrect behavior in printf on non-x86 archs (%a format with
precision specifier), in getopt_long_only when short options are a
prefix for a long option, in complex arc-trig/hyperbolic functions, in
strftime and mktime (timezone-specific issues), and numerous
less-obvious places.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[altered commit msg a bit keeping it tight]
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-09-04 21:27:00 +00:00
|
|
|
@@ -518,6 +525,7 @@ size_t iconv(iconv_t cd, char **restrict
|
2014-05-28 23:18:47 +00:00
|
|
|
c = ksc[c][d];
|
|
|
|
if (!c) goto ilseq;
|
|
|
|
break;
|
|
|
|
+#endif
|
|
|
|
default:
|
2017-11-19 16:19:23 +00:00
|
|
|
if (!c) break;
|
2017-11-05 18:01:02 +00:00
|
|
|
c = legacy_map(map, c);
|
toolchain/musl: update to version 1.1.20
This release introduces the ability to replace/interpose the allocator
(malloc) subject to certain restrictions, adds an experimental m68k
port, and makes notable improvements to stdio (application-provided
buffers), getaddrinfo (AI_ADDRCONFIG, support for IPv4-only kernel
configurations), the dynamic linker (safety against dlopen of
libraries using initial-exec TLS model, reclaiming unused memory on
FDPIC archs, better dladdr results), and handling of default thread
stack size (pthread_setattr_default_np now works more reliably).
Many bugs have been fixed, including potentially dangerous regressions
in iconv (only for new conversions to legacy encodings) and visibly
incorrect behavior in printf on non-x86 archs (%a format with
precision specifier), in getopt_long_only when short options are a
prefix for a long option, in complex arc-trig/hyperbolic functions, in
strftime and mktime (timezone-specific issues), and numerous
less-obvious places.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[altered commit msg a bit keeping it tight]
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-09-04 21:27:00 +00:00
|
|
|
@@ -559,6 +567,7 @@ size_t iconv(iconv_t cd, char **restrict
|
2017-11-19 16:19:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
goto subst;
|
|
|
|
+#ifdef FULL_ICONV
|
|
|
|
case SHIFT_JIS:
|
|
|
|
if (c < 128) goto revout;
|
|
|
|
if (c == 0xa5) {
|
toolchain/musl: update to version 1.1.20
This release introduces the ability to replace/interpose the allocator
(malloc) subject to certain restrictions, adds an experimental m68k
port, and makes notable improvements to stdio (application-provided
buffers), getaddrinfo (AI_ADDRCONFIG, support for IPv4-only kernel
configurations), the dynamic linker (safety against dlopen of
libraries using initial-exec TLS model, reclaiming unused memory on
FDPIC archs, better dladdr results), and handling of default thread
stack size (pthread_setattr_default_np now works more reliably).
Many bugs have been fixed, including potentially dangerous regressions
in iconv (only for new conversions to legacy encodings) and visibly
incorrect behavior in printf on non-x86 archs (%a format with
precision specifier), in getopt_long_only when short options are a
prefix for a long option, in complex arc-trig/hyperbolic functions, in
strftime and mktime (timezone-specific issues), and numerous
less-obvious places.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[altered commit msg a bit keeping it tight]
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2018-09-04 21:27:00 +00:00
|
|
|
@@ -632,6 +641,7 @@ size_t iconv(iconv_t cd, char **restrict
|
2017-11-19 16:19:23 +00:00
|
|
|
*(*out)++ = 'B';
|
|
|
|
*outb -= 8;
|
|
|
|
break;
|
|
|
|
+#endif
|
2018-02-22 22:54:04 +00:00
|
|
|
case UCS2:
|
|
|
|
totype = UCS2BE;
|
2017-11-19 16:19:23 +00:00
|
|
|
case UCS2BE:
|
2014-05-28 23:18:47 +00:00
|
|
|
--- a/src/locale/codepages.h
|
|
|
|
+++ b/src/locale/codepages.h
|
2017-11-19 16:19:23 +00:00
|
|
|
@@ -129,6 +129,7 @@
|
|
|
|
"\340\204\43\316\100\344\34\144\316\71\350\244\243\316\72\354\264\343\316\73"
|
|
|
|
"\21\361\44\317\74\364\30\145\17\124\146\345\243\317\76\374\134\304\327\77"
|
2014-05-28 23:18:47 +00:00
|
|
|
|
|
|
|
+#ifdef FULL_ICONV
|
|
|
|
"cp1250\0"
|
|
|
|
"windows1250\0"
|
2017-11-19 16:19:23 +00:00
|
|
|
"\0\40"
|
|
|
|
@@ -239,6 +240,7 @@
|
|
|
|
"\20\105\163\330\64\324\324\145\315\65\330\144\243\315\66\334\334\145\330\67"
|
|
|
|
"\340\204\43\316\100\344\224\143\316\71\350\244\243\316\72\205\265\343\316\73"
|
|
|
|
"\21\305\203\330\74\364\330\145\317\75\370\344\243\317\76\374\340\65\362\77"
|
2014-05-28 23:18:47 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
"koi8r\0"
|
2017-11-19 16:19:23 +00:00
|
|
|
"\0\40"
|