XLS with UTF-8 charset

I was implementing a XLS file PHP generator recently and I stumbled upon a problem with the XLS file charset, which I needed to be UTF-8. Here is how I solved this problem ...

Why can't you change the XLS file encoding


The XLS files are binary files, thus you can't change their charset. No headers or other techniques can solve this, this is a principal thingie :)

So what's the solution ?


The fact that we can't change the charset of course is NOT a solution. But we can achieve the desired effect simply by converting text we want to use in XLS before we use it. We can use one from already coded charset converting classes, there's no problem to find one. I use this one. On this site you'll have to register first, but I'm sure you can work around this .. ;) With the convert charset code you just have to convert your text e.g. to windows-1250 charset. And that's all, njoy :)