通过 Aspose.Cells 在输出 PDF 中渲染 Unicode 增补字符
Contents
[
Hide
]
普通 Unicode 字符的长度为 2 个字节,而 Unicode 增补字符的长度为 4 个字节。 Aspose.Cells 现在支持渲染这些 4 字节的 Unicode 字符。
在 Unicode 字符标准中,增补字符是分配了代码点从 U+10000 到 U+10FFFF 的字符。换句话说,这些是大于 U+FFFF 的 Unicode 字符。
- 在 UTF-8 中,这些字符每个都是 4 个字节长。
- 在 UTF-16 中,这些字符需要 2 个代理项(16 位单元)。
通过 Aspose.Cells 在输出 PDF 中渲染 Unicode 增补字符
以下屏幕截图显示了 Aspose.Cells 如何呈现源文件进入输出 PDF.如您所见,所有三个 Unicode 增补字符都呈现为与 Microsoft Excel 完全相同。
示例代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load your source excel file containing Unicode Supplementary characters | |
Workbook wb = new Workbook(dataDir + "unicode-supplementary-characters.xlsx"); | |
// Save the workbook | |
wb.Save(dataDir + "RenderUnicodeInOutput_out.pdf"); |