#1 29 Apr 2018 11:16

New Member
Registered: 29 Apr 2018
Posts: 1

how to use find in 'CHCP 65001'

> echo "bla" | find "a"
> bla
> chcp 65001
> echo "bla" | find "a"

?!? roll

The CMD can always be so wonderfully frustrating.
I start my script and it change to codepage 65001 cause I work with ffmpeg an have to use UTF-8.
But first I forgot that I working in that codepage
and wonder for days why that:

 echo "foobär" | find "ä" && goTo:DoSomething || goTo:DoSomethingElse

chain don't work anymore.

Wy that isn't working in different codePage?

Seems I need a workaround again and again in CMD,
well we know - cause is Microsoft-CMD-System...  - bah! ;-)

What did you prefer? Chance the codpage everytime is complicated.
Use FindStr seems to be slower -nor?


#2 30 Apr 2018 18:14

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 997

Re: how to use find in 'CHCP 65001'

When working with anything that has a real requirement for Unicode then I think CMD is the wrong tool to choose.

Use PowerShell, once you get the hang of it you will never look back.


Board footer

Powered by FluxBB