西班牙语文本在 ActionScript 中未正确编码
我有一个包含西班牙语文本的 XML。我注意到,当我将此 XML 追踪到包含未正确表示的重音符号的字符串字符时。我通过追踪单个字符“è”来测试这一点,输出为“É”
trace("è"); //outputs é
在 ActionScript 中如何解决这个问题?谢谢!!
受影响的 XML 示例:
'<month name="month6"> ' +
'<link.content document-href="tn5684" section-href="tn5687" document-type="SPECIAL-TOPIC" rank="1" link-url="">Bebé prematuro</link.content> ' +
'<link.content document-href="tn8416" section-href="tn8416" document-type="DP-TOPIC" rank="2" link-url="">¿Cómo puedo tomar decisiones informadas sobre mi bebé extremadamente prematuro?</link.content> ' +
'</month> ' +
文本出现在列表组件中。我正在更改字体以找到一种可能有效的字体,但这不起作用。有人知道如何在列表组件中表示重音字符吗?
更新
从外部文件加载XML文档不会出现同样的问题:
var myXML:XML = new XML(); myXML.load("someXmlFile.xml");
//这有效
,但是我需要将此 xml 内置到 SWF 中。因此,我从字符串创建 XML:
var xmlString:String = "<root><textNode>bebè</textNode></root>";
var myXML:XML = new XML(xmlString); //This breaks the encoding?!
Sorry Gang 因此,我使用 Flash Develop 来编辑包含 xml 的动作脚本。这显然没有正确编码文本。在 CS5 中打开此文件,对其进行编辑,保存修复了该问题。呃!
I have an XML that contains Spanish text. I noticed that when I traced out this XML to a string characters that contain accents where not correctly represented. I tested this by tracing out a single character, "è" and the output is "é"
trace("è"); //outputs é
How is this resolved in ActionScript? Thanks!!
Sample of the XML that is affected:
'<month name="month6"> ' +
'<link.content document-href="tn5684" section-href="tn5687" document-type="SPECIAL-TOPIC" rank="1" link-url="">Bebé prematuro</link.content> ' +
'<link.content document-href="tn8416" section-href="tn8416" document-type="DP-TOPIC" rank="2" link-url="">¿Cómo puedo tomar decisiones informadas sobre mi bebé extremadamente prematuro?</link.content> ' +
'</month> ' +
The text appears in a List Component. I am changing the font around to find one that might work but this is not working. Anyone know how to represent accented characters in a List component??
Update
Loading the XML document from an external file does not have the same problem:
var myXML:XML = new XML();
myXML.load("someXmlFile.xml");
//This works
However I need this xml to be built into the SWF. So am creating the XML from a string:
var xmlString:String = "<root><textNode>bebè</textNode></root>";
var myXML:XML = new XML(xmlString); //This breaks the encoding?!
Sorry Gang
So I was using Flash Develop to edit the actionscript that contains the xml. This was apparently not encoding the text correctly. Opening this file in CS5, editing it, saving fixed the issue. DUH!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
控制台不支持重音
Accents are not supported in the console