Free Support Forum - aspose.com

Word Save docx encode UTF-8+BOM can charset UTF-8

I have the following code:


Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln(“Hello World!”);
SaveOptions opt = SaveOptions.createSaveOptions(SaveFormat.DOCX);
FileOutputStream out = new FileOutputStream(f);
doc.save(out, opt);

After The Run is Completed Word Rename test.docx to test.docx.zip Open [Content_Types].xm File Is
UTF-8+BOM Encode

I Can Of Set utf-8 Encode ?

Hi,


Thanks for your inquiry.

Have you tried latest version of Aspose.Words i.e. 15.12.0?
Please share your output document here for our reference.

What is variable ‘f’ in following line?
FileOutputStream out = new FileOutputStream(f);
Please share complete code without compilation errors.

What xml editor you’re using for viewing this [Content_Types].xml?

Best regards,
Hi awais.hafeez is not online. Last active: 01-06-2016, 9:59 AM Awais,

Thank you very much

I Use latest version of Aspose.Words i.e. 15.12.0.complete code Next

String dataDir = "src/helloworld/data/";
File f = new File(dataDir + "HelloWorldOut.docx");
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Hello World!");
SaveOptions opt = SaveOptions.createSaveOptions(SaveFormat.DOCX);
FileOutputStream out = new FileOutputStream(f);
doc.save(out, opt);

Created HelloWorldOut.docx File rename HelloWorldOut.docx.zip after open
Use Notepad++ view the [Content_Types].xml xml document Encoding is UTF-8+BOM

I want to know that can change into a utf-8 encoded ?
Hi,

Thanks for your inquiry. We tested the scenario and have managed to reproduce the same problem on our end. For the sake of any correction, we have logged this problem in our issue tracking system as WORDSNET-12920. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

A post was split to a new topic: Saving to DOCX encodes with UTF-8+BOM instead of charset UTF-8