2

when you do something like 'echo ö > test.txt' in a dos box, you will not find an "ö" in test.txt, but a double quote. I learned to overcome this by starting the dos box with "cmd /u", which works fine.

But: findstr does not seem to care... If I do something like 'findstr "some_txt" . > result.txt', any "ö"s that appear in the file names found will be displayed as double quotes again.

Any idea?

holger_b
  • 21
  • 2
  • Have you tried with `find`, or is this not an option for you? – aschipfl Oct 07 '15 at 11:26
  • Thank you. I know find and I use it in other situations, but here the problem is that the output file does not contain the proper characters, so I do not see how find could help me here. – holger_b Oct 07 '15 at 11:59
  • My intention was to find out whether the problem is caused by `findstr` or not... – aschipfl Oct 07 '15 at 12:01
  • Oh, it just occurred to me that I misunderstood you - you were suggesting to use find instead of findstr. I tried that, but the only difference is I end up with a '™' instead of a double quote, which does not help either... – holger_b Oct 07 '15 at 12:09
  • Hmm... seems that the redirection in `cmd` is the problem... maybe you could try to change the code page (see `mode /?` for helphow to do that; you'll need to search the web for the correct value); what does `mode con: cp` return? `850`, I guess...?? – aschipfl Oct 07 '15 at 12:51
  • It was 437, initially. Your idea sounded very promising and I tried 850, 1200, 1201, 1250 and 65001 (using chcp) but none of them made a difference. The screen output is correct btw, it is just about the file contents when the output is redirected. – holger_b Oct 07 '15 at 13:31
  • What a pity...! maybe you are interested in [this related post](http://stackoverflow.com/a/2708563/5047996)... – aschipfl Oct 07 '15 at 13:36

0 Answers0