Text problems
hello,
i'm working in director since 2 weeks , learn bit bit new parts.
now have 1 problem displaying text in sprite.
the situation follow:
i read data xml file (this necessary because text variable , need easy editable)
so read xml file in , process sprite.
the problem have special characters not recognized , mess total text.
some of code
on updateslidedata (me,data)
member("t_slideoutputtext").text=""
if voidp(data) exit
body = "<html><body bgcolor=""e&"#ffffff""e&"><font color=""e&"#2c2f64""e&" size=""e&"4""e&" face=""e&"arial""e&">"
lineheights =[]
previousline =1
txt = ""
id = 1
if voidp(data[#tcs])
member("t_slideoutputtext").html = ""
return data
end if
if data[#tcs] <> "" then
repeat in data[#tcs]
txtfromslide = i[#data]
case i[#type] of
1,11:-- type 1 : normal title
txt = txt&"<b>"&txtfromslide&"</b><br />"
2,12:-- type 2 : -->
txt = txt&"-> "&txtfromslide&"<br />"
3,13:-- type 3 : vb
txt = txt&" "&txtfromslide&"<br />"
4,14:-- type4 : 4
txt = txt&""&txtfromslide&"<br />"
9:
txt = txt&" "&"<br />"
end case
txt = me.cleantxt(txt)
txt = gstring.cleanrepeatedchar(txt)
-- if txt[2] = true alert ("error" &txt)
txt = txt[1]
on cleanrepeatedchar me,var
if voidp(var) return ["",true]
repaired = false
return [var,repaired]
end
on cleantxt me,txt
if not voidp(txt)
if txt<>"" then
txt = str_regreplace("'","'",txt)
txt = str_regreplace("°","°",txt)
txt = str_regreplace(return,"<br />",txt)
txt = str_regreplace("\[br\]","<br />",txt)
txt = str_regreplace("&","&",txt)
txt = str_regreplace("'","'",txt)
if myeditor=false then
txt = gcdcontent.createtxthtml(txt)
else
return txt
end if
--
-- txt = str_regreplace("&","&",txt)
-- txt = str_regreplace("\[br\]","<br />",txt)
-- txt = str_regreplace(return,"<br />",txt)
end if
end if
return txt
end
in underlined code special characters become unreadable.
what solution problem ?
can provide example of goes in, comes out, , what's going wrong?
More discussions in Director Basics
adobe
Comments
Post a Comment