I'm pretty sure the intention in this example is the ® symbol - a registered trademark type symbol. Somehow on the companies end this data is getting screwed up, and they are apparently working on it - though that might mean a few months of no fix, and I have historical data that I need to use in the mean time. What I'm looking for is an equivalent way to do what the "utf8_decode" function in PHP does, but in Perl. A simple example in PHP would be something like this, that does what I want:Some Companyî Some CompanyÃÂÃÂÃÂÃÂÃÂÃÂÃÂî Some CompanyÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂî
I've been trying to get Encode::encode and Encode::decode to work here, but they don't seem to be able to actually unravel this mess. With my PHP hack script I can decode it to this:$prev = $value; for($i=0;$i<999;$i++) { $value = utf8_decode($value); if ($prev == $value) { break; } $prev = $value; print "[$i]$value\n"; }
I would probably then want to re-encode the final one back into utf8 and proceed from there. I know this is very hacky, but I need a workaround until they fix the data source. Any ideas?Some Companyî [0]Some Company® [1]Some Company® ------------------ Some CompanyÃÂÃÂÃÂÃÂÃÂÃÂÃÂî [0]Some CompanyÃÂÃÂÃÂî [1]Some CompanyÃÂî [2]Some Companyî [3]Some Company® [4]Some Company® ------------------ Some CompanyÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂî [0]Some CompanyÃÂÃÂÃÂÃÂÃÂÃÂÃÂî [1]Some CompanyÃÂÃÂÃÂî [2]Some CompanyÃÂî [3]Some Companyî [4]Some Company® [5]Some Company®
In reply to doulbe/triple/multi encoded utf8 by fert
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |