Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_EvalEx function not detecting "\n" in Windows.

Closed / Invalid3483424fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 14 years ago
Descriptionplain2012-02-03 02:46:15
Hi,

I am using TCL version 8.4.19  on a 64 bit Windows machine.
In my C++ code I am calling Tcl_EvalEx () and passing a string argument  like "hi\nbye\nbye_again".
But after evaluation the string is printed as "hi(some special character)bye(some specialcharacter)bye_again".

Even I tried with "hi\\nbye\\nbye_again, then output is "hi\nbye\nbye_again"
with "hi\\r\\nbye\\r\\nbye_again" , then the output is "hi\r\nbye\r\nbye_again".

The expected output is : hi
                                        bye
                                        bye_again

Could you please help?
sebresplain2012-02-03 16:32:02
On windows should you intrinsically use a pair "\r\n" (CRNL) instead of "\n" (NL, unix) for really new line...
What do you mean by output?
stdout? if yes - you can configure you stdout channel to translation auto - it will accept both.

## get a current translation :
fconfigure stdout -translation
## set a translation to auto :
fconfigure stdout -translation auto
dgpplain2012-02-06 22:14:30
The report needs to be much clearer.

Precisely what are you passing to Tcl_EvalEx()?
What is the result?  How is that different from what you
expect?
dgpplain2012-02-07 00:45:41
Without more information, this ticket
will auto-close, assuming the issue is
just confusion about the -translation setting
of a Tcl channel.
dgpplain2012-06-05 21:00:13
allow_comments - 1
Log in (anonymous is fine) to add a comment.