|
newby Newbie
Joined: 27 Oct 2003 Posts: 4 Location: USA
|
Posted: Tue May 18, 2004 2:18 pm
converting to ascii? |
Is there a way to convert a string captured from a trigger to ascii without assigning it to a variable?
#TR {(*)} {Here I want to convert %1 to ascii before assigning it to a variable}
The reason I'm doing this is because there are special characters in the string and if I assign it to a variable it comes out all garbled... Thanks |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Tue May 18, 2004 3:04 pm |
I think what you really want to do is replace any special character with some other character or with nothing.
Take a look at the %replace function
%replace(%1,"-"," ")
that will replace "-" with a space
Also
What are the special char that are not working and how are you assigning it to a variable.
#var string "%1"
This will assign everything in %1 into string without parsing it.
#var string %1
This will parse through zmud. |
|
|
|
newby Newbie
Joined: 27 Oct 2003 Posts: 4 Location: USA
|
Posted: Tue May 18, 2004 3:44 pm |
...
I didn't state the problem clear enough... I'm on a chinese mud, it's a 2bit language, and for some reason zmud seems to parse some of the characters. I don't have a list of the characters, so I was thinking of converting the whole string into ascii.
One of the main problem causing characters is "¿", is it a special character in zmud? If there's no general way of doing this, I guess I'll just make a list of problem characters and add more as I find them then... Thanks |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue May 18, 2004 8:03 pm |
zMUD does not have support for multi-byte languages. For this reason, your triggers won't be able to do much with the text received from the MUD because the two bytes per character will confuse it.
|
|
|
|
|
|