mIRC Home    About    Download    Register    News    Help

Print Thread
UTF-8 display problem #186173 18/09/07 02:23 PM
Joined: Jan 2003
Posts: 20
T
Tewl Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 20
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.

Last edited by Tewl; 18/09/07 02:33 PM.
Re: UTF-8 display problem [Re: Tewl] #186204 19/09/07 12:01 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: UTF-8 display problem [Re: Tewl] #186207 19/09/07 12:21 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.

Last edited by Riamus2; 19/09/07 12:22 AM.

Invision Support
#Invision on irc.irchighway.net
Re: UTF-8 display problem [Re: Riamus2] #186243 19/09/07 09:32 PM
Joined: Jan 2003
Posts: 20
T
Tewl Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 20
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.

Last edited by Tewl; 20/09/07 12:04 AM.
Re: UTF-8 display problem [Re: Tewl] #186247 19/09/07 10:02 PM
Joined: Jan 2003
Posts: 20
T
Tewl Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 20
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

Re: UTF-8 display problem [Re: Tewl] #186251 19/09/07 11:00 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That does seem to be a problem with the UTF-8... what network is that? I don't know which networks allow UTF nicks.


Invision Support
#Invision on irc.irchighway.net
Re: UTF-8 display problem [Re: Riamus2] #186258 20/09/07 12:02 AM
Joined: Jan 2003
Posts: 20
T
Tewl Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 20
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.

Re: UTF-8 display problem [Re: Tewl] #186271 20/09/07 07:20 AM
Joined: Dec 2002
Posts: 4,917
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,917
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.

Re: UTF-8 display problem [Re: Khaled] #186272 20/09/07 07:35 AM
Joined: Jan 2003
Posts: 20
T
Tewl Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 20
doh! I didn't even think about that =\

Re: UTF-8 display problem [Re: Tewl] #186284 20/09/07 01:38 PM
Joined: Jan 2003
Posts: 20
T
Tewl Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 20
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.

Last edited by Tewl; 20/09/07 01:42 PM.
Re: UTF-8 display problem [Re: Tewl] #186287 20/09/07 01:46 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: UTF-8 display problem [Re: qwerty] #186288 20/09/07 02:27 PM
Joined: Jan 2003
Posts: 20
T
Tewl Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 20
Thanks qwerty, that sorted the problem for me.