Skip to content

Commit b667607

Browse files
authored
Prevent a deadlock when LOG4CXX_CHAR=utf-8 and LOG4CXX_CHARSET=EBCDIC (#250)
1 parent b36f3b7 commit b667607

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/main/cpp/charsetdecoder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,7 @@ class LocaleCharsetDecoder : public CharsetDecoder
466466

467467
try
468468
{
469-
LogString e;
470-
Transcoder::decode(encoding, e);
469+
LOG4CXX_DECODE_CHAR(e, encoding);
471470
decoder = getDecoder(e);
472471
}
473472
catch (IllegalArgumentException&)

src/main/cpp/charsetencoder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,7 @@ class LocaleCharsetEncoder : public CharsetEncoder
494494
else if (encoding != enc)
495495
{
496496
encoding = enc;
497-
LogString ename;
498-
Transcoder::decode(encoding, ename);
497+
LOG4CXX_DECODE_CHAR(ename, encoding);
499498

500499
try
501500
{

src/main/cpp/exception.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ using namespace log4cxx::helpers;
2929

3030
Exception::Exception(const LogString& msg1)
3131
{
32-
std::string m;
33-
Transcoder::encode(msg1, m);
32+
LOG4CXX_ENCODE_CHAR(m, msg1);
3433
size_t len = m.size();
3534

3635
if (len > MSG_SIZE)

0 commit comments

Comments
 (0)