mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Hi all.
I have a sockread connection that indicaste the last notices in a journey the site www.publico.pt

The site have a RSS link and recently they have change for RSS version 2.0. Since that time i had a problem.

I have two echos...

echo -s $+( Notícia, /, %titulo) $+( [, %pnum, ]) $var( %noticia, 1).value [Publico.pt Última Hora]

echo -s $chr(91) $+  $+ %pnum $+  $+ $chr(93) $var( %noticia, 1).value


The firts echo is the original echo and he is not parsing the 16 bit letters.
Example --> Notícia/ [9] Sub-21: Portugal quer esquecer Bulgária com vitória no Montenegro [Publico.pt Última Hora]

The second echo i have add it to check whery was the problem, but i can´t find any thing rong.
Example --> [9] Sub-21: Portugal quer esquecer Bulgária com vitória no Montenegro

Has you can see in both exmples they are using the same var but for some readon the firts one is not parsing correctly the 16 bit charcter.

Is this a bug or something ??
If is not how can i fix it to pul all the information on the firts echo work ??

Thanks for all and hope you understand...

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Some characters will cause mIRC to not use UTF-8 when displaying text. That's most likely your problem. You can use $utfencode() around the character(s) that are causing the problem or just not include those in the output. Note that the actual unicode characters are NOT what you want to use $utfencode on. It would be something like « or ». If those are in a line with unicode, the unicode will not display properly unless you use $utfencode on those characters.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Do you know what char´s are that we can not use for UTF-8 display text ?

thanks for all

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I think anything outside of the normal ASCII range. Beyond that, I really don't know. I don't do much with UTF. Someone else can probably give more specifics.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
try google


This is not the signature you are looking for
Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Originally Posted By: Riamus2
Some characters will cause mIRC to not use UTF-8 when displaying text. That's most likely your problem. You can use $utfencode() around the character(s) that are causing the problem or just not include those in the output. Note that the actual unicode characters are NOT what you want to use $utfencode on. It would be something like « or ». If those are in a line with unicode, the unicode will not display properly unless you use $utfencode on those characters.


Humm naa it can´t be that... see this

echo -s %noticia <-- It works correctly
echo -s $+( [, %pnum, ]) %noticia <-- It works correctly
echo -s Notícia $+( [, %pnum, ]) %noticia <-- It Not Works correctly
echo -s Noticia $+( [, %pnum, ]) %noticia <-- It works correctly

If you noted the last one and the one before the last one the only diference it´s the í chaged to i...

It´s a bug... know i have certainf off that

Thanks any way

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Originally Posted By: Miguel_A
If you noted the last one and the one before the last one the only diference it´s the í chaged to i...

It´s a bug... know i have certainf off that

You're certainly wrong. Before decoding text as UTF-8 mIRC checks that the entire (wrapped) line is in fact valid UTF-8. This is an important requirement as it prevents text that was not encoded to UTF-8 from being decoded as such (which would often result in garbage). All characters with a value above 127 must be correctly encoded, and í has a value of 192.

mIRC provides a simple way to encode text to valid UTF-8:

Code:
echo -s $utfencode(Notícia) $+( [, %pnum, ]) %noticia

Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Humm i see Collective

I have try to see on help about that identifier but mirc help does not have that help and i have thougt that identifier dosen´t exist.

But you are right and ther is and $utfencode identifier, but the mirc help don´t have him.

Thanks and sorry the rong post in bug board.

Last edited by Miguel_A; 16/10/07 08:18 PM.
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Indeed, it was never added to the help file, the only reference is in versions.txt (6.17):

Quote:
Added $utfencode(text, C) and $utfdecode(text, C), where C is the
script/codepage ($window().script) of the plain text


Link Copied to Clipboard