in reply to Replacing a character in a file

Hi, you don't want to just throw that away! That character is produced by an encoding failure. You need to know what is the encoding of the data in your database, then decode from that to Perl when you fetch the data, then encode to the character set your output is using. That way you will get the special characters as they were originally.

(This assumes that the data was encoded correctly begin with.) Since you are on Windows your data might be encoded in Windows-1252.

Disclaimer: I am not a windows user but I saw your question had been here for a while with no replies.

To remove a character with a Perl regexp: perl -E '$str = "fxoox"; $str =~ s/x//g; say $str;' (output: foo).

See perlretut and perlrequick. But that is not the right solution here.

Hope this helps!


The way forward always starts with a minimal test.