[ 
https://issues.apache.org/jira/browse/LOGCXX-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15411524#comment-15411524
 ] 

Thorsten Schöning commented on LOGCXX-483:
------------------------------------------

{CODE}
I've tried printing hebrew, and I still get question marks. I expected that if 
I used consoleAppender->setEncoding("us-ascii"), the console appender would 
simply write ascii, and I would then see it as some weirdly encoded characters, 
but it still prints out question marks.
{CODE}

Your expectation is wrong, hebrew characters can't be mapped to US-ASCII and 
therefore the question mark is printed. That is the placeholder/replacement for 
your "weirdly encoded characters", so your described behaviour make sense and 
seems correct to me. I guess what you expected is that log4cxx encodes your 
data into UTF-8 and prints the binary representation of that, but that is 
somethign completely different than using US-ASCII. So try UTF-8 instead and 
see what happens under different environments of your shell. If you redirect 
the console output on the shell using ">" to a file an dlook at the in a hex 
editor, you should be able to see if it's properly encoded UTF-8 of your output 
or not. If so and it is displayed wrongly, your shell is wrongly configured for 
UTF-8 output. If it is no UTF-8 in the redirect already, there's still 
something wrong with your strings forwarded to log4cxx or with the internal 
encoding applied or whatever...

{CODE}
How can I make it so it simply spits out the characters I put in, as in just 
the binaries, regardless of how I write it?
{CODE}

You can't, simply because you input characters and not binary octets and 
log4cxx is designed to output characters and not binary octects and characters 
and strings always have some encoding. You need to get your input encoding 
right, check what log4cxx uses to produce your output and if that is compatible 
with the environment you output it in. I really don't know what I can say else, 
you need to look at the complete processing chain.

> Not able to see hebrew values when logging in log4cxx
> -----------------------------------------------------
>
>                 Key: LOGCXX-483
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-483
>             Project: Log4cxx
>          Issue Type: Bug
>         Environment: Linux Debian 8 32bit
>            Reporter: Giora Guttsait
>
> When logging messages with a console appender (whose output is directed to a 
> file), hebrew text is shown as weird symbols.
> It really affects out ability to debug and analyze the program output at 
> specific points, so a quick fix(if possible) would be great



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to