Force UTF8 encoding during writeLines

This should fix #549 where R writes file according to default locale if not otherwise specified. It caused a problem under Windows due to lack of support for UTF8 locale and rCharts assumes everything will be written in UTF8.
I suggest you open the `file()` connection here, and close it after writing the text. Otherwise the file() connection is still open after this function exits, and R might show you "Closed 1 unused connections".