mIRC Home    About    Download    Register    News    Help

Print Thread
#245871 11/05/14 01:38 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Hello,

Does anyone know how can i convert these to be displayed correctly? is there any alias? or any identifer to use?

please help!

text: Áãþíáò ÊõðÝëëïõ Êáëáèïóöáßñéóçò ÐÁ ¸ôïõò 2014 ìåôáîý ôùí ÏìÜäùí ôçò 110ÐÌ êáé ôïõ 1ïõ ÊÅÐ

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #245872 11/05/14 03:59 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Where did you get that?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #245873 11/05/14 04:05 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
I found the solution : $utfdecode($utfencode(TEXT,1))

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #245874 11/05/14 04:16 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
That's not the solution. Where did you get that?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #245879 11/05/14 05:26 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
From an socket result's return.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #245880 11/05/14 05:39 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
I'm not exactly sure why you think you found the solution because $utfdecode($utfencode(TEXT,1)) is the exact same thing as TEXT itself...
From which url/website did you get this? what's the language supposed to be?

Last edited by Wims; 11/05/14 05:39 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #245881 11/05/14 05:51 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
I'm trying to get informations from an website and the results was in greek language, while saving the results did not saved correct, now with this identifier is ok.

Language: Greek
Site: http://feeds.feedburner.com/haf/Xdoo?format=xml

Check it to see.

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #245884 12/05/14 01:10 AM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
That webpage uses the charset Windows 1253 to encode it, it's similar to the greek charset (ISO/IEC 8859-7) so you must first encode those bytes/code point in utf8, but you must encode the characters corresponding to each byte/code point in the greek charset, not in unicode (there is no support for the Window 1253 codepage/charset as far as I know with $utfencode and $utfdecode):

Take a look here for more information about it, but I'll explain a bit:

Takes the Gamma letter for example, it has the code point 195 in the greek charset, it has the code point 915 in unicode. In mIRC $chr(915) evaluate to that letter.

$utfencode($chr(915)) produces the utf8 sequence of the unicode code point used (915).
$utfencode($chr(195),161) produces the utf8 sequence of the character corresponding to the code point used (195) in the specified charset (161 being the greek charset).
So both are equivalent.
Now back to your example you know you're dealing with the greek charset (a similar charset in reality: windows 1253) so you are going to use $utfdecode($utfencode(TEXT,161)).
$utfencode(TEXT,161) will encode each byte (according to the greek charset, as we said) in utf8, and then $utfdecode will decode that back.

$utfdecode($utfencode(TEXT,1)) is just TEXT because 1 is the default.



#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #245888 12/05/14 05:29 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Anyway i use this for now because the code is complicated and problem fixed, also the 1 because is the default it's auto converting, i have try this and with arabic characters and work, so until now it's ok :P

- Thanks for your definition.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard