mIRC Home    About    Download    Register    News    Help

Print Thread
#221107 07/05/10 09:31 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline OP
Hoopy frood
OP Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Now that mIRC can represent $chr() values > 256 (Unicode codepoints) it would be a lot simpler and less confusing if those values could be represented in base-16, as this is the standard representation for Unicode codepoints (U+nnnn).

The following syntaxes would be beneficial to users:

//echo -a $chr(0x0E03)
//echo -a $chr(U+0E03)

The latter syntax being the standard Unicode codepoint notation. This would make it easier for users to copy paste these codepoints out of programs like charmap.exe and websites like these.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
$char($base(#,16,10)) ^.^


I am SReject
My Stuff
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline OP
Hoopy frood
OP Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Knowing when to and when not to do base conversion is the problem.

Most users would assume: U+0155 == $chr(155). They would be wrong.

This is actually further muddled by the fact that Windows Alt+NNNN codes are represented in base10 but U+NNNN codes are base16.

So a user might think Alt+0155 == U+0155. They would be wrong about that too.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
yea. But those fooling around with unicode generally know that alt+155 != U+0155 -shrugs- I do see where u are coming from, but instead of having $chr(u...) have $uchr(...)


I am SReject
My Stuff
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Agreed, that would be very handy.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2009
Posts: 116
Vogon poet
Offline
Vogon poet
Joined: Jan 2009
Posts: 116
Sounds like a good idea to me, argv0's syntax seems sensible, although perhaps a seperate identifier like $uchr() could be nice. Either way, I'd love to see it being added! :_)


http://zowb.net

/server -m irc.p2p-network.net -j #zomgwtfbbq
(ssl on port 6697 and 7000)
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Guess adding this would mean I have to again edit a script so it uses a different format since I'm using it as $chr(NNNN) for the unicode character. frown


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
Originally Posted By: Riamus2
Guess adding this would mean I have to again edit a script so it uses a different format since I'm using it as $chr(NNNN) for the unicode character. frown


No, it wouldn't break existing scripts. I believe this was the idea:

$chr(NNNN) --> treat NNNN as base 10 value
$chr(0xNNNN) --> treat NNNN as base 16 value
$chr(U+NNNN) --> treat NNNN as base 16 value

Joined: Jul 2006
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
Do not agree. Unicode notation is hexadecimal while mirc operates with decimal numbers. Its pretty logical to have a scripter to convert before feeding to $chr()

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
Unicode notation is hexadecimal while mirc operates with decimal numbers

Hence the suggestion.


Quote:
Its pretty logical to have a scripter to convert before feeding to $chr()

Is it? It makes far more sense to me for scripts (and therefore scripters) to use codepoints in their most common form to make it easier for anyone reading the code to recognise which characters are being represented.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jul 2006
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
Originally Posted By: starbucks_mafia
Quote:
Its pretty logical to have a scripter to convert before feeding to $chr()

Is it? It makes far more sense to me for scripts (and therefore scripters)

Hell is other scripters - Sartre. ;-)

In my personal opinion suggested way will add more confusion than benefit.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Where's the confusion? $chr() will work exactly as it always has, but there will now be a shorthand way of working with hexadecimal numbers.

It's extremely simple really:

$chr(<number>) if you want to use decimal.
$chr(0x<number>) or $chr(U+<number>) if you want to use hexadecimal.


Link Copied to Clipboard