wordfence-cli icon indicating copy to clipboard operation
wordfence-cli copied to clipboard

Error: 'ascii' codec can't encode character '\U0001f4a1' in position 55: ordinal not in range(128)

Open varunvarde opened this issue 5 months ago • 3 comments

I am getting this error while scanning the server.

Error: 'ascii' codec can't encode character '\U0001f4a1' in position 55: ordinal not in range(128)

Command I used: wordfence malware-scan -a --output-path wordfence.csv /home /tmp /var/www

I am using the latest version.

varunvarde avatar Jul 29 '25 05:07 varunvarde

Can you try running this again with the --debug option and capture the output so we can see where exactly that error is occurring?

akenion avatar Jul 29 '25 13:07 akenion

Opened PR #335 to fix the Unicode output error. Reports now open their output files with UTF-8 encoding and a regression test checks the flag. Let me know if anything else pops up!

mmaunder avatar Sep 23 '25 03:09 mmaunder

I'm not sure switching to UTF-8 is the correct solution. Files scanned could be in any arbitrary encoding and not all possible binary sequences are valid UTF-8 so this introduces a different potential issue. I'm leave #335 open for now, but I think this needs further consideration and I'm omitting it from the 5.0.2 milestone.

akenion avatar Oct 13 '25 14:10 akenion