Hello,
I am using Aspose.words to generate word documents and I’d like to know how unicode characters, more specifically paperclip emoji, can be rendered when writing a doc.
This is a small snippet written in coldfusion that attempts to write the paperclip emoji using “Segoe UI Emoji” font. However it renders the string “1F4CE” instead of .
Hello World!
` `
This example shows how to create a simple MS Word document using Aspose.Words
` `
` `
` `
` `
<cfset builder.write(“1F4CE”)>
<cfset doc.save(“C:\Temp\out.doc”)>
Regards,
Jhonathan
@Jhonathan_Arenas,
Thanks for your inquiry. Please use the Unicode character of paper clip as shown below to get the desired output.
builder.write("\uD83D\uDCCE");
@tahir.manzoor,
Thanks for your answer. I had tried that but still it renders the string “\uD83D\uDCCE” instead of
. Is there any extra options in the save method that tells Aspose to write those characters properly?
@Jhonathan_Arenas,
Thanks for your inquiry. We have tested the scenario using following Java code example with latest version of Aspose.Words for Java 17.11. We have not found the shared issue. Please use Aspose.Words for Java 17.11. We have attached the output DOCX with this post for your kind reference. output.zip (4.9 KB)
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setName("Segoe UI Emoji");
builder.write("\uD83D\uDCCE");
doc.save(MyDir + "output.docx");
@tahir.manzoor
Thanks for your answer. I have no clue why my implementation does not work. I downloaded Aspose.Words for Java 17.11 but still nothing. Is it because I am using Coldfusion? This is the file my code generates out.zip (5.0 KB).
Regards,
Jhonathan.
@Jhonathan_Arenas,
Thanks for your inquiry. Aspose.Words writes Unicode character into document without any issue. Please check the detail of Unicode character ‘PAPERCLIP’ from here:
Unicode Character ‘PAPERCLIP’ (U+1F4CE)
Please also check following web links. Hope these help you.
Convert string to utf-8 unicode in ColdFusion
ColdFusion won’t display unicode (utf-8) characters