* src/support/unicode.C

(IconvProcessor::convert): Fix hex output of bytes on systems where
	char is signed


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16468 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2007-01-02 20:44:06 +00:00
parent d96c36e555
commit bcbd895143

View File

@ -150,10 +150,13 @@ int IconvProcessor::convert(char const * buf, size_t buflen,
<< " has been encountered in the input.\n" << " has been encountered in the input.\n"
<< "When converting from " << fromcode_ << "When converting from " << fromcode_
<< " to " << tocode_ << ".\n"; << " to " << tocode_ << ".\n";
lyxerr << "Input: " << std::hex; lyxerr << "Input:" << std::hex;
for (size_t i = 0; i < buflen; ++i) { for (size_t i = 0; i < buflen; ++i) {
boost::uint32_t const b = buf[i]; // char may be signed, avoid output of
lyxerr << "0x" << b << " "; // something like 0xffffffc2
boost::uint32_t const b =
*reinterpret_cast<unsigned char const *>(buf + i);
lyxerr << " 0x" << b;
} }
lyxerr << endl; lyxerr << endl;
break; break;
@ -162,10 +165,13 @@ int IconvProcessor::convert(char const * buf, size_t buflen,
<< " has been encountered in the input.\n" << " has been encountered in the input.\n"
<< "When converting from " << fromcode_ << "When converting from " << fromcode_
<< " to " << tocode_ << ".\n"; << " to " << tocode_ << ".\n";
lyxerr << "Input: " << std::hex; lyxerr << "Input:" << std::hex;
for (size_t i = 0; i < buflen; ++i) { for (size_t i = 0; i < buflen; ++i) {
boost::uint32_t const b = buf[i]; // char may be signed, avoid output of
lyxerr << "0x" << b << " "; // something like 0xffffffc2
boost::uint32_t const b =
*reinterpret_cast<unsigned char const *>(buf + i);
lyxerr << " 0x" << b;
} }
lyxerr << endl; lyxerr << endl;
break; break;