writing file from binary string problem

hello guys,

i'm creating a pdf document and have the base64 string. i decode the string to a binary string and save the document with the ion writefile function but on saving it will change mutation letters like Ä, Ö, Ü (wÃ¼rzburg).

But when i copy the binary string from the console and past it into a file it will not change.