utf8 codification problem C#, writing a tex file, and compiling with pdflatex
- by voodoomsr
Hi, i have the next code written in C#....it create a tex file using utf-8.....the problem is that appears that is not a real valid utf-8 file because, when i use pdflatex it doesn't recognize the characters with accents. Somebody knows a way to write a real UTF-8 file? When i use TexmakerX to create a utf8 file with the same latex code, pdflatex doesn't complaints, so the problem must be in the generation.
FileInfo file = new FileInfo("hello.tex");
StreamWriter writer = new StreamWriter("hello.tex", false, Encoding.UTF8);
writer.Write(@"\documentclass{article}" + "\n" +
@"\usepackage[utf8]{inputenc}" + "\n" +
@"\usepackage[spanish]{babel}" + "\n" +
@"\usepackage{listings}" + "\n" +
@"\usepackage{fancyvrb}" + "\n" +
@"\begin{document}" + "\n" +
@"\title{asd}" + "\n" +
@"\maketitle" + "\n" +
@"\section{canción}" + "\n" +
@"canción" + "\n" +
@"\end{document}");
writer.Close();