以 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">HELLO WORLD!!!!</text>
Example .
关于unicode - 如何在 SVG 中显示 unicode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19134995/