I was hoping to make it thinner than that -- I've done this before (like a few years ago) but now that I'm in my 30's, I have trouble remembering such things! The utf8 package is a good fallback though.Any straight regex, though?
Wow, is THAT ugly! But it works well, thank you!My situation is that I need to strip out all non-UTF8 characters as it comes from an external source (SharePoint). The problem is that the character set could be absolutely anything (and often is) so a translation function is not feasible. I'll have it mapping certain characters to UTF8 equivalents but anything else will be trashed.Again, thanks.