|
Returns the character corresponding to ascii character code in number. (number must 0 to 255).
Syntax
asciichar( number )
Returns the ascii character code
|
User Annotations:
asciichar
An alternative way to write Claudiu's script is like so. This version als illustrates miva_array_deserialize() and the new mvforeach tag.
<mvfunction name = " Iso2" parameters = " ret" Standardoutputlevel = " text,html,compresswhitespace" >
<mvassign name = " l.line" value = " {miva_array_deserialize('¡,¢,£,¥,¦,§,¨,©,ª,«,¬,*,®,¯,°,±,²,³,´,µ,¶,·,¸,¹,º,»,¼,½,¾,¿,À,Á,Â,Ã,Ä,Å,Æ,Ç,È,É,Ê,Ë,Ì,Í,Î,Ï,Ð,Ñ,Ò,Ó,Ô,Õ,Ö,×,Ø,Ù,Ú,Û,Ü,Ý,Þ,ß,à,á,â,ã,ä,å,æ,ç,è,é,ê,ë,ì,í,î,ï,ð,ñ,ò,ó,ô,õ,ö,÷,ø,ù,ú,û,ü,ý,þ,ÿ')}" >
<mvassign name = " l.asci" value = " {miva_array_deserialize('161,162,163,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255')}" >
<mvforeach iterator = " l.char" array = " l.line" index = " l.cnt" >
<mvassign name = " l.ret" value = " {glosub(l.ret,asciichar(l.asci[l.cnt]),l.char)}" >
</mvforeach>
<mvfuncreturn value = " {l.ret}" >
</mvfunction>
Here is a function that gives the possibility to manually change characters to ISO:
<mvfunction name = " Iso" parameters = " ret" Standardoutputlevel = " text,html,compresswhitespace" >
<mvassign name = " l.line" value = " {'¡,¢,£,¥,¦,§,¨,©,ª,«,¬,­,®,¯,°,±,²,³,´,µ,¶,·,¸,¹,º,»,¼,½,¾,¿,À,Á,Â,Ã,Ä,Å,Æ,Ç,È,É,Ê,Ë,Ì,Í,Î,Ï,Ð,Ñ,Ò,Ó,Ô,Õ,Ö,×,Ø,Ù,Ú,Û,Ü,Ý,Þ,ß,à,á,â,ã,ä,å,æ,ç,è,é,ê,ë,ì,í,î,ï,ð,ñ,ò,ó,ô,õ,ö,÷,ø,ù,ú,û,ü,ý,þ,ÿ'}" >
<mvassign name = " l.asci" value = " {'161,162,163,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255'}" >
<mvwhile expr = " { l.cnt LT (1+(len(l.line)-len(glosub(l.line,',',''))))}" >
<mvassign name = " l.cnt" value = " {l.cnt+1}" >
<mvassign name = " l.ret" value = " {glosub(l.ret,asciichar(gettoken(trim(l.asci),',',l.cnt)),gettoken(trim(l.line),',',l.cnt))}" >
</mvwhile>
<mvfuncreturn value = " {l.ret}" >
</mvfunction>
To call the function:
<mvassign name = " l.text" value = " {'Some text to convert to ISO'}" >
<mvassign name = " l.text" value = " {Iso(l.text)}" >
|