[xml/sgml-pkgs] Bug#273600: After switch to native transcoder, KOI8-R support in xerces23 is broken

Nikita V. Youshchenko "Nikita V. Youshchenko" <yoush@cs.msu.su>, 273600@bugs.debian.org
Mon, 27 Sep 2004 12:58:47 +0400


This is a multi-part MIME message sent by reportbug.

--===============1551151242==
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="KOI8-R"
Content-Disposition: inline

Package: libxerces23
Version: 2.3.0-2
Severity: normal

Hello.

After I upgraded xerces23 packages from 2.3.0-2 to 2.3.0-4 (as part of a
larger upgrade), I've got report from my users that their code that uses
xerces does not work any longer. After some inversigation, I found the
following changelog entry:

  * Switch from GNU transcoder to native transcoder

This looks to break KOI8-R support.

Minimal example code is attached, provided by one of uor users, is
attached.

nikita@zigzag:~/adm/xerces> cat test2.xml
<?xml version="1.0" encoding="KOI8-R"?>
<Global>
        <Text>Некий текст</Text>
</Global>
nikita@zigzag:~/adm/xerces> ./t test2.xml

File parsed successfully
nikita@zigzag:~/adm/xerces> LD_LIBRARY_PATH=2.3.0-4/usr/lib ./t test2.xml
Fatal: An exception occurred! Type:TranscodingException, Message:Could not create a converter for encoding: KOI8-R  line: 1


-- System Information:
Debian Release: 3.0
  APT prefers testing
  APT policy: (620, 'testing'), (600, 'unstable'), (550, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-1-k7-smp
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R

Versions of packages libxerces23 depends on:
ii  libc6                  2.3.2.ds1-16      GNU C Library: Shared libraries an
ii  libgcc1                1:3.4.1-4sarge1   GCC support library
ii  libstdc++5             1:3.3.4-6sarge1.2 The GNU Standard C++ Library v3

-- no debconf information

--===============1551151242==
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="t.cpp"

#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/sax/HandlerBase.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/PlatformUtils.hpp>

#include <iostream>

XERCES_CPP_NAMESPACE_USE
using std::cout;

class my_err_handler: public HandlerBase	//override base error handling class
{
	void fatalError(const SAXParseException &exception) {
		char* message = XMLString::transcode(exception.getMessage());
		cout << "Fatal: " << message << "  line: " << exception.getLineNumber() << "\n";
		XMLString::release(&message);
		exit(1);
	}
};

int main(int argc,char **argv)
{
	if (argc < 2) {
		cout << "\nYou must specify file to parse\n";
		return -1;
	}
	XMLPlatformUtils::Initialize();
	XercesDOMParser *parser=new XercesDOMParser();
	parser->setValidationConstraintFatal(true);
	ErrorHandler* errHandler = (ErrorHandler *) new my_err_handler();
	parser->setErrorHandler(errHandler);
	parser->parse(argv[1]);	 //parse the file
	cout << "\nFile parsed successfully\n";
	return 0;
}

--===============1551151242==
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/xml; charset="KOI8-R"
Content-Disposition: attachment; filename="test2.xml"

<?xml version="1.0" encoding="KOI8-R"?>
<Global>
	<Text>Некий текст</Text>
</Global>
--===============1551151242==--