문제

i need to remove all multibyte characters from a file, i dont know what they are so i need to cover the whole range.

I can find them using grep like so: grep -P "[\x80-\xFF]" 'myfile'

Trying to do a simular thing with sed, but delete them instead.

Cheers

도움이 되었습니까?

해결책

Give this a try:

LANG=C sed 's/[\x80-\xFF]//g' filename

다른 팁

you can use iconv to convert from one encoding to another

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top