简体   繁体   中英

Display accented characters in an SVG object in an html page

Accented characters (acute e etc) do not display in my svg object within an html page. The page is declared:

<!DOCTYPE html>
<html lang="en">
<head runat="server">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> ..

and the SVG file:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"

What's my big mistake?

does this show up right for you?

 <svg> <text y="15">äöüëèéê</text> </svg> 

The answer is that if your linked svg file includes accented characters then in asp.net you should use an object:

<object type='image/svg+xml' data='<%#Container.DataItem("FieldName")%>'></object>

rather than the otherwise recommended image:

<asp:Image runat="server" ImageUrl='<%#Eval("FieldName")%>'/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM