F
F
favor1t2020-12-10 20:15:55
Character encoding
favor1t, 2020-12-10 20:15:55

Comparing a Russian filename with a variable containing Russian?

I'm trying for a file named "January 10, 2020.xlsx" with a construction like

for /f "tokens=2,* " %%b in ("%%y") do if %%b=="января" set mm=01

compare the file name with the variable and convert the value to a numeric value in a simple way,
but the if condition does not work, I guess it's in the encoding, I
tried it differently
in notepad ++ cp1251, 866
I tried in the batch file at the beginning through chcp to indicate the same values
​​in the end in the condition instead of " January" wrote kryakozyabry taken from the online decoder
does not take anything
Tell me how it works?
cmd is launched by default in 866 encoding
for reads the path to the file into the variable b ... and in what encoding is this value stored with the variable?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question