Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
StonedMOFO
Beginner


Joined: 22 Sep 2004
Posts: 28

PostPosted: Sun Jul 24, 2005 6:07 pm   

My solution to multi-byte language and zmud trigger
 
I will first show some screenshot and explain why there is problem with multi-byte character. And I will explain some way of fixing it.

First, why zmud is able to both output and input multi-byte characters. Basically, if your operation system support multi-byte input / output, then so will zMud. Since Windows XP has built-in support for multi-byte language (during installation, when you are setting up the Regional and Language Options, be sure to select "Install files for East Asian languages, this apply to any verison of Windows XP), or if you have already install Windows, simpy go to "Regional and Language Options" under Control Panel and follow threw the same procedure. Also under "Text services and input languages" click "Details" and be sure to "Add..." the input system for the language you desire.



Now we have the input/output taken care of, let's proceed to discussion as to why there is problem with multy-byte character. Essentiall multi-byte character means using more then one byte to compose a letter. so AA may represent the word "sky" in chinese (it doesn't this is just an example), these 2 byte is not limited to the A-Z !@#$%^&*()_+, this essentially is the UNICODE system which I would not go into detail

What happen when zMUD encounter most multi-byte characters? nothing at all! But the time you do have problem(s) is when the character at stake contains zMUD control byte, such as @ } { ~ # or anything that is in the control byte list! as you can tell, what happen when your trigger pattern has ~ in it? Well zmud is taking the ~ in as escape character, and hence screw up the next character's first byte, and your first character would be missing the second byte, so essentially you get another word cause you are combining the first byte of the first character with the first byte of the second character, and basically causes everything behind it to be screw up. example-> A~KBCDEF zmud would treat it like AK BC DE F
instead of A~ KB CD EF. Below is a screen shot using Chinese BIG5 Traditional character as an example, you do not need me to tell you what those chinese letter means to know it's screw up inside the trigger.


And here is a screen shot of attempt to use the two words in first screenshot as pattern for a trigger

and here is what happen when I go to the Test tab

as you can see, the pattern did not translate! THIS IS IMPORTANT, any time you input a multi-byte (or anything) pattern, you need to check it in the test tab. If the pattern does not automatically show up inside the test input, then it will not fire. This sounds weird, but essentially, this mean even if the pattern I enter show up in the mud, it won't fire this trigger, because zMud did not correctly capture / or interpret the word. To solve this is actually quite simple, here is what I did to the pattern to solve this problem.

instead of attempting to capture the words at stake, I simply turn the words into ?? which mean "any two characters will do", hence zMUD simply ignore those two byte.

So to make all this short, always check inside the Test Tab to see if your pattern will cause any problem, and if it does, identify the problem and replace the specific words with wildcard -> ??
This is a viable solution because in multi-byte character, it is rare for you to have just one words to work with.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jul 25, 2005 4:16 pm   
 
Thanks very much for this post! This kind of post is really informative to those of us who don't have any way to play with this or understand exactly how it works and how it's broken.

With your good explanation, I have a better idea of what is causing the problems in zMUD with multi-byte languages. That means there is a bigger chance for things to get fixed in future versions.

If you'd be interested as a beta tester for multi-byte language support, please send me an email at support@zuggsoft.com and we'll discuss this in more detail.
Reply with quote
StonedMOFO
Beginner


Joined: 22 Sep 2004
Posts: 28

PostPosted: Tue Jul 26, 2005 1:12 pm   I've emailed you
 
Yes I be willing to assist you in any way to attempt to solve this issue(s) :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net