chmln / sd

Intuitive find & replace CLI (sed alternative)
MIT License
5.85k stars 138 forks source link

Error: Windows stdio does not support writing non-UTF-8 byte sequences #122

Open sergeevabc opened 3 years ago

sergeevabc commented 3 years ago

Source: koi8-r.zip

$ sd -p "<meta.*?charset=.*?>" $1 koi8-r.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">                                                                               
<!-- saved from url=(0035)http://www.chat.ru/~bozzo/women.htm -->                                                                            
<!-- BEGIN Naviscope Javascript --><HTML><HEAD><TITLE>Error: Windows stdio in console mode does not support writing non-UTF-8 byte sequences 
yooakim commented 2 years ago

I hade the same issue in Windows 11 @sergeevabc - for me the problem was that the input file hade some bad first bytes. Can you ensure your input file is a good format? If you can check on Linux try file <inputfile> and see if it is a know format?

jd-solanki commented 1 year ago

this offtopic but How you guys installed it on windows?

sergeevabc commented 10 months ago

Errr... It seems this issue is still not resolved. I have downloaded a file mentioned in the original first message and run the same command as before with a fresh SD 1.0 release. The app did not generate an error, but only a blank screen, while the file itself remained unchanged.


@yooakim

$ file koi8-r.htm
koi8-r.htm: HTML document, ISO-8859 text, with CRLF line terminators

@jd-solanki, there is pre-compiled Windows binary to download, unpack and run.

yooakim commented 5 months ago

this off topic but How you guys installed it on windows?

I use Cargo to install on Windows @jd-solanki