Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Euro sign € does not work in TCC batch files

Hi, following case:

There are several archived files in a folder named 9€_.....jpg
When I run "dir /b 9€*.* >a:\Archived.txt" in a batch file
all these 9€_....jpg are properly shown with the €-character in Archived.txt

However, when I run "set file=%@line[a:\archived.txt,0]" and then "echo %file",
%file does not show the Euro sign (€) but some other, cryptic sign.

So, when I try to run "copy %file" to some target folder, I get the error message
"... file %file not found ..."

Is there a way to get TCC to recognize and use the Euro sign € ??

Thanks a lot
Hansueli Hof - Basel/Switzerland
 
I would suggest that you use Unicode for the output file. Do an option //unicodeoutput=yes before redirecting to Archived.txt and see if that doesn't help matters.
 
Code page 437 is problematic here; code page 1252 is not.

1654703714984.png
 
I don't know what it means, but with either CP 437 or CP 1252, TCC can't echo @CHAR[0x80].

1654786896260.png
 
Not surprising, as code page 1252 includes the euro sign and CP437 does not.
Is that some sort of rule? '±' is not in code page 437 but TCC can echo it.

1654787911370.png


OK, that could be that a while back (because I wanted that symbol) I changed the one of these that was not 1252.

Code:
v:\> regdir /v /d HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage | grep -E "CP.*(437|1252)"
  ACP : REG_SZ : 1252
  OEMCP : REG_SZ : 1252

I reckon TCC is not using a numbered code page when it translated between WideChar and MultiByte, but rather CP_ACP or CP_OEMCP.
 
Is that some sort of rule? '±' is not in code page 437 but TCC can echo it.

View attachment 3652

TCC uses Unicode internally. @CHAR takes Unicode values, and @ASCII (laughably misnamed, these days) returns Unicode values.

Your code page shouldn't matter when writing to the screen. If TCC can't display the plus-and-minus sign, I would suspect your console font. (Avoid the old raster fonts; they include very limited sets of characters.)

I reckon TCC is not using a numbered code page when it translated between WideChar and MultiByte, but rather CP_ACP or CP_OEMCP.

I think it uses whatever CHCP reports. Which probably defaults to CP_OEMCP until you change it.
 
Back
Top
[FOX] Ultimate Translator
Translate