Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit afe8f84

Browse files
committed
runtest: Work around broken EUC-JP support in musl iconv
Should fix #728.
1 parent 0cde1b7 commit afe8f84

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

runtest.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4938,7 +4938,25 @@ launchTests(testDescPtr tst) {
49384938

49394939
ebcdicHandler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_EBCDIC);
49404940
ibm1141Handler = xmlFindCharEncodingHandler("IBM-1141");
4941+
4942+
/*
4943+
* When decoding EUC-JP, musl doesn't seem to support 0x8F control
4944+
* codes.
4945+
*/
49414946
eucJpHandler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_EUC_JP);
4947+
if (eucJpHandler != NULL) {
4948+
xmlBufferPtr in, out;
4949+
4950+
in = xmlBufferCreateSize(10);
4951+
xmlBufferCCat(in, "\x8f\xe9\xae");
4952+
out = xmlBufferCreateSize(10);
4953+
if (xmlCharEncInFunc(eucJpHandler, out, in) != 3) {
4954+
xmlCharEncCloseFunc(eucJpHandler);
4955+
eucJpHandler = NULL;
4956+
}
4957+
xmlBufferFree(out);
4958+
xmlBufferFree(in);
4959+
}
49424960

49434961
if (tst == NULL) return(-1);
49444962
if (tst->in != NULL) {

0 commit comments

Comments
 (0)