mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2011
Posts: 16
I
ircuser Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Jul 2011
Posts: 16
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 ?

Joined: Mar 2010
Posts: 146
Vogon poet
Offline
Vogon poet
Joined: Mar 2010
Posts: 146
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.


Nothing...
Joined: Jul 2011
Posts: 16
I
ircuser Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Jul 2011
Posts: 16
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 ....

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2011
Posts: 16
I
ircuser Offline OP
Pikka bird
OP Offline
Pikka bird
I
Joined: Jul 2011
Posts: 16
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.

Last edited by ircuser; 10/12/11 11:34 PM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard