As a side not, the problem isn't that TextEdit doesn't write UTF8 (which it most certainly does), but the fact that, unless you explicitly change your settings, it automatically replaces the apostrophe ' with a quote symbol ‘ which is not what you want in this case.