2

so i Have mIRC 7.21 that it has by default UTF-8 enabled.
So i have this socket:

on *:sockopen:_tmdb_*:{
  sockwrite -tn $sockname GET $hget($sockname,url) HTTP/1.1
  sockwrite -tn $sockname Host: "nah"
  sockwrite -tn $sockname User-Agent: mIRC-API/v1-Alpha
  sockwrite -tn $sockname Accept: application/json
  sockwrite -tn $sockname Connection: close
  sockwrite -tn $sockname $crlf $+ $crlf
}

I'm getting by default these headers by the remote server:

[Header] HTTP/1.1 200 OK
[Header] Access-Control-Allow-Origin: *
[Header] Age: 0
[Header] Cache-Control: public, max-age=3600
[Header] Content-Type: application/json;charset=utf-8
.....

And i'm getting this response when it is written in english:

Extended Play 2006 47247

Though, when i'm trying to change the language. I'm making request to the api server and defining &language=el. I'm getting this:

Headers:

[Header] HTTP/1.1 200 OK
[Header] Access-Control-Allow-Origin: *
[Header] Age: 0
[Header] Cache-Control: public, max-age=3600
[Header] Content-Type: application/json;charset=utf-8
.....

Result:

Πέντε Λεπτά ΑκΟΞΌΞ± 2006 47247

When i open the stored JSON file, mIRC downloaded... i can see just fine the greek charset. mIRC Cannot. Any ideas why my charset is getting messed up through sockets? I mean i can just write fine with a small //echo -a Πεντε λεπτα ακόμη. And it is displaying it just fine. Though through sockets is getting messed up..
Extended Play

Devian
  • 817
  • 1
  • 12
  • 22

1 Answers1

0
if $utfdecode($utfencode($1-,162)) {
...
}

charset codes below, our charset code 162

000 - ANSI_CHARSET
001 - DEFAULT_CHARSET
002 - SYMBOL_CHARSET
077 - MAC_CHARSET
128 - SHIFTJIS_CHARSET
129 - HANGEUL_CHARSET
130 - JOHAB_CHARSET
134 - GB2312_CHARSET
136 - CHINESEBIG5_CHARSET
161 - GREEK_CHARSET
162 - TURKISH_CHARSET
163 - VIETNAMESE_CHARSET
177 - HEBREW_CHARSET
178 - ARABIC_CHARSET
186 - BALTIC_CHARSET
204 - RUSSIAN_CHARSET
222 - THAI_CHARSET
238 - EASTEUROPE_CHARSET
255 - OEM_CHARSET
CoCoRiCo
  • 1
  • 2