mIRC Home    About    Download    Register    News    Help

Print Thread
utf-8 problem #157624 27/08/06 12:53 AM
Joined: Aug 2006
Posts: 11
D
daGroove Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Aug 2006
Posts: 11
i got a problem with an echo code with $chr(160) and utf-8,

if i write
on ^*:TEXT:*:*:{ haltdef | echo -tmfli2r $target $nick $1- }

i get the line like that: "Die Mac-version hei▀t X-Chat Aqua."

but if i write
on ^*:TEXT:*:*:{ haltdef | echo -tmfli2r $target $chr(160) $nick $1- }

i get the line written wrong like that: "Die Mac-version hei├čt X-Chat Aqua." (the mac-version is x-chat aqua) the word hei├čt should be hei▀t

is this a bug in mirc 6.2 or is there a way to get this correct ?


sorry for my english smile
Re: utf-8 problem #157625 27/08/06 01:05 AM
Joined: Apr 2004
Posts: 853
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 853
Hello! That's not a bug; the $chr(160) is not a valid utf-8 sequence but still a character with an ascii value above 127 - and as a result mIRC assumes that the whole line isn't utf-8 encoded and doesn't decode the rest either. If you want utf-8 to work, make sure not to use any ascii characters above 127 that aren't utf-8 sequences. You can do that by encoding these characters as utf-8 first, for example using $utfencode($chr(160),0) instead of just $chr(160) in this case.


Saturn, QuakeNet staff
Re: utf-8 problem #157626 27/08/06 01:43 AM
Joined: Aug 2006
Posts: 11
D
daGroove Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Aug 2006
Posts: 11
thanks !

but now mirc slows down frown

Last edited by daGroove; 27/08/06 02:57 AM.