gpt4 book ai didi

unicode - 如何在 SVG 中显示 unicode?

转载 作者:行者123 更新时间:2023-12-03 12:26:48 25 4
gpt4 key购买 nike

以 SVG 格式存储在数据库中的信息。如果数据包含文本,它将显示为 Unicode。
需要在浏览器中正确显示 SVG 文件。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="header"
viewBox="654.0519483 -714.4517 356.4000564 252">
<defs></defs><g id="0" visibility="visible">
<text id="gText_11081308229940" name="-1" x="790.251953" y="-631.9517"
font="Arial" rotate="0" horizAnchor="middle" vertAnchor="middle" scale="4,4" width="1" stroke="0x000000">
\u0048\u0045\u004C\u004C\u004F\u0020\u0057\u004F\u0052\u004C\u0044\u0021\u0021\u0021\u0021 </text>
</g></svg>
当我尝试此代码时,我会显示 Unicode 而不是字母。

最佳答案

如果您真的想插入 Unicode 值而不是仅仅选择正确的编码并将字符直接放入其中,请使用您在 any other XML document 中使用的实体。 :

    <text id="gText_11081308229940" name="-1" x="790.251953" y="-631.9517" font="Arial" rotate="0" horizAnchor="middle" vertAnchor="middle" scale="4,4" width="1" stroke="0x000000">&#x0048;&#x0045;&#x004C;&#x004C;&#x004F;&#x0020;&#x0057;&#x004F;&#x0052;&#x004C;&#x0044;&#x0021;&#x0021;&#x0021;&#x0021;</text>

Example .

关于unicode - 如何在 SVG 中显示 unicode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19134995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com