mIRC Homepage
Posted By: ircuser How can I guess the Encoding ? - 10/12/11 05:27 PM
I have received a line of text from a person that doesn't use mirc while I use a new version of mirc, my first question, what is the encoding I see, UTF8 ? My second question how can I guess the senders encoding ?
Posted By: Masoud Re: How can I guess the Encoding ? - 10/12/11 05:41 PM
You can use $isutf()

Code:
if ($isutf($1-)) { echo -ag It's UTF-8 }
else { echo -ag It's Codepage. }


Returns 1 if the given string is UTF-8, otherwise returns 0.
It is undocumented... But yet it's there for you to use.
Posted By: ircuser Re: How can I guess the Encoding ? - 10/12/11 07:28 PM
Originally Posted By: Masoud
You can use $isutf()

Code:
if ($isutf($1-)) { echo -ag It's UTF-8 }
else { echo -ag It's Codepage. }


Returns 1 if the given string is UTF-8, otherwise returns 0.
It is undocumented... But yet it's there for you to use.


Thank you for your help but I am not trying to make any script, I am just trying to find a way to know what was said to me by guessing the senders encoding, I don't know if this is possible or not or how ....
Posted By: argv0 Re: How can I guess the Encoding ? - 10/12/11 10:08 PM
You want to find a way to guess the encoding? Well, the way is to script it. Alternatively you could spend time manually figuring out what codepages each character comes from-- but that's why we have computers, to do hard work for us. If you're asking whether mIRC has this builtin, the answer is no, it's not builtin. It is possible to do, but you have to script it.
Posted By: ircuser Re: How can I guess the Encoding ? - 10/12/11 11:32 PM
Originally Posted By: argv0
You want to find a way to guess the encoding? Well, the way is to script it. Alternatively you could spend time manually figuring out what codepages each character comes from-- but that's why we have computers, to do hard work for us. If you're asking whether mIRC has this builtin, the answer is no, it's not builtin. It is possible to do, but you have to script it.


"Returns 1 if the given string is UTF-8, otherwise returns 0.
It is undocumented... But yet it's there for you to use"

When I get replies such as the above that tries to answer what is already known and pissed off for no reason replies like yours that doesn't answer the question, why would I want to start a scripting project? and why haven't you already done it if it is so easy? did somebody force you to reply because I really don't need your useless sarcastic comment.
Posted By: starbucks_mafia Re: How can I guess the Encoding ? - 10/12/11 11:45 PM
I'm not sure if there's a language barrier here that's causing problems or whether you've just got an attitude, but no-one here has responded with anything unreasonable or useless.

So you want to know what encoding was used for an incoming message; you asked if it might be UTF-8. What exactly is wrong with using $isutf() to determine that and how would anyone be expected to guess that it was 'already known' to you since it apparently answers at least part of your original question?

If the answers are useless to you then you need to be clearer with your question. And maybe take a moment to calm down before lashing out at people who are only trying to help you.
Posted By: argv0 Re: How can I guess the Encoding ? - 11/12/11 12:00 AM
It's not "a scripting project", it's "a script". Scripts don't need to be complicated things. You can start with something like:

Code:
on *:TEXT:*:*:echo -a UTF8: $isutf($rawbytes)


If your goal is to get an answer that requires you to do no scripting at all, I've already indicated that mIRC does not support this builtin-- if you truly have something against writing a script, you're using the wrong client. FWIW, I don't know any client that would tell you what encoding a line has without some sort of non-standard customization. The answer is going to be "you have to script it" no matter how many times you ask.

As to why I've never done this before... I've never done such a thing because I don't need it. You do. Therefore, you're the one who should script it. It has nothing to do with easy or hard. Note that for UTF-8 checks, the script is easy. If you want to find out what codepage a line of text might be, the script would be much more complicated. I never said it was going to be easy though. I just said it was possible.
© mIRC Discussion Forums