haveabun
asked on
Problems using ä ö å as ascii characters in C# string to convert text file to PDF file
I am reading (using streamreader) from a txt file which is divided and written to multiple files (using streamwriter), these files are converted using AdultPDF Text To PDF. The original txt file is created in a unix system and copied to windows. I suspect it is written using ascii encoding because it converts fine with the swedish characters ä ö å to the PDF file usinf 'Text to PDF', but when I have divided the the file using an app created in VS2005 C# the output textfiles are fine when the encoding is default(unicode I believe). But when converting to PDF using 'Text to PDF' the output characters are 'Ã' instead of 'Ä' / 'Ã' instead of 'Ö' / 'Ã&' instead of 'Å' .
When I use ASCII encoding for the streamwriter I get the character '?' instead of the swedish characters both in the output txt and pdf file.
I use the commandline solution to convert the text file to PDF using 'Text to PDF' : http://www.adultpdf.com/products/txttopdf/index.html
I have tried it on both a swedish and english version of windows.
I might be doing this all wrong, so I am happy to try any suggestions.
Thank you!
When I use ASCII encoding for the streamwriter I get the character '?' instead of the swedish characters both in the output txt and pdf file.
I use the commandline solution to convert the text file to PDF using 'Text to PDF' : http://www.adultpdf.com/products/txttopdf/index.html
I have tried it on both a swedish and english version of windows.
I might be doing this all wrong, so I am happy to try any suggestions.
Thank you!
At the time of reading you can specify the Encoding.UTF8 in Streamreader and try
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.