Fixes encoding issues when using regex =~ operator