Bonjour,
Est-ce que quelqu'un aurait des references EN FRANCAIS sur la gestion de l'encodage des chaines/flux en .NET ?
De preference des sites "reellement" en français (pas des traductions vite faites des sites anglais).
La gestion de l'encoding sous .net c'est reellement nebuleux pour moi.
Ex:
toto.cs:
...
string path= Server.MapPath(".");
XPathDocument myXPathDocument = new XPathDocument(path + @"\toto.xml");
XslTransform myXslTransform = new XslTransform();
StringWriter writer = new StringWriter();
myXslTransform.Load(path + @"\toto.xsl");
myXslTransform.Transform(myXPathDocument, null, writer);
Response.Write("resultat:"+writer.ToString());
...
Toto.xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
version="1.0" exclude-result-prefixes="msxsl ">
<xsl:output method="xml" media-type="image/svg+xml"
encoding="ISO-8859-1" indent="yes" />
<xsl:template match="/">
<svg width="625" height="392.5" viewBox="0 0 625 392.5" xml:space="preserve">
<title>toto</title>
<rect id="monrect" x="5" y="40" width="200" height="200" ry="20" rx="20" />
</svg>
</xsl:template>
</xsl:stylesheet>
Toto.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<table>
</table>
Résultat:
<?xml version="1.0" encoding="utf-16"?>
<svg width="625" height="392.5" viewBox="0 0 625 392.5" xml:space="preserve">
<title>toto</title>
<rect id="monrect" x="5" y="40" width="200" height="200" ry="20" rx="20" />
</svg>
POURQUOI utf-16 ?!!!! (pourquoi pas UTF-8 (qui m'irait)? Ou cp-1252 ? Ou ISO-klingon ? Et surtout pourquoi pas iso-8859-1 ?)
D'avance merci,
Vincent Pennec
PS:J'espere que je n'étais pas trop OT.
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Received on Thu Dec 1 12:24:52 2005