mIRC Homepage
Posted By: Tewl UTF-8 display problem - 18/09/07 02:23 PM
I chat a server the has UTF-8 support and I noticed a display issue in my theme today while trying to send pm's to a user.

The users name was -¤Chuck¤- which when decoded looks like -¤Chuck¤-

The problem comes wehn my theme goes to echo messages into the query window.

.echo $active $me $+ 11: $1-

and

.echo $nick $nick $+ 11: $1-

ect...

only the $1- data will show in the query window for myself and the received messages are displayed in the status window without the name or colon again.

I tried opening a window and doing "//echo $active test" and i get: * /echo: insufficient parameters

But! if I do "//echo $active test test" it returns "test", it is removing the first word of input.
Posted By: argv0 Re: UTF-8 display problem - 19/09/07 12:01 AM
if echo $active test test only echo's test, that doesn't seem like a UTF-8 problem to me... what are your settings in alt-o -> irc -> messages (multibyte editbox, display, etc.)? That will help someone reproduce it, because I cannot reproduce the //echo $active test thing
Posted By: Riamus2 Re: UTF-8 display problem - 19/09/07 12:21 AM
It sounds as though you have "echo" aliased so that it's removing the first word.

Or, perhaps more likely, you have an on INPUT event that handles your theme and that's what is messed up.
Posted By: Tewl Re: UTF-8 display problem - 19/09/07 09:32 PM
Yes I have display and encode enabled on the fonts, all the multibyte display,editbox and jsis ect.. enabled.

No I do not have an echo alias and I seriously doubt it has anything to do with my INPUT or TEXT events in my theme.

They are pretty basic:

Code:
on ^*:TEXT:*:?: {
  .echo $nick $+($nick,11: $1-)
  .halt
}
on *:input:?: {
  if ($left($1-,1) != /) && ($comchan($active,0) > 0) {
    .whisper $comchan($active,1) $active $1- 
    .echo $active $+($me,11: $1-)
    .halt
  }
}


I do not seem to have this issue with any other users that have utf-8 formatting in their nicknames. I am absolutely certain it has something to do with the characters in the mentioned nickname.
Posted By: Tewl Re: UTF-8 display problem - 19/09/07 10:02 PM
To add a more visual response i did 10 tests on the query window and created an image of the input and results.

http://i90.photobucket.com/albums/k252/Tewl187/mirc.png
Posted By: Riamus2 Re: UTF-8 display problem - 19/09/07 11:00 PM
That does seem to be a problem with the UTF-8... what network is that? I don't know which networks allow UTF nicks.
Posted By: Tewl Re: UTF-8 display problem - 20/09/07 12:02 AM
It's irc.buzzen.net, but the server is not your standard IRC server. It is IRCx and requires a special authentication method to connect. If you are interested in getting on and seeing what I am talking about check their forums on buzzen.com and sign up for a free account.
Posted By: Khaled Re: UTF-8 display problem - 20/09/07 07:20 AM
Since the nickname begins with a - switch prefix, when you use it with /echo the - is parsed for switches and the next word is used as the window name. If the IRC server you are using allows nicknames to begin with the - character (standard IRC networks do not allow this) you would need to cater for this in your scripts.
Posted By: Tewl Re: UTF-8 display problem - 20/09/07 07:35 AM
doh! I didn't even think about that =\
Posted By: Tewl Re: UTF-8 display problem - 20/09/07 01:38 PM
I was looking into finding a way to cater to it in my script, the only ideas can come up with are:

a) Making the query the active window when a message is received and then just doing echo -a switch. This could get messy and may not always be accurate.
or
b) Replacing the characters in the server data with another character that would not cause this problem. This could be an eyesore and generally a lot more to process.

I'm not a great solutions developer, I know :@

Anyways, I noticed that you can retrieve a window id and handle using the $query().wid and $query().hwnd identifiers. I went through the help file and there is no way to echo into a window given those 2 parameters. I was wondering if that would be a possible to add, if I haven't over looked it.
Posted By: qwerty Re: UTF-8 display problem - 20/09/07 01:46 PM
You can just use existing switches in /echo other than -a. Chances are you want them anyway, you just don't know it yet. For example:

echo -mbflirt $nick $nick $+ 11: $1-

If you don't know what these specific switches do, type /help /echo in any mirc window.
Posted By: Tewl Re: UTF-8 display problem - 20/09/07 02:27 PM
Thanks qwerty, that sorted the problem for me.
© mIRC Discussion Forums