$ and | Character Escaping

Technical discussion about the NMDC and <a href="http://dcpp.net/ADC.html">ADC</A> protocol. The NMDC protocol is documented in the <a href="http://dcpp.net/wiki/">Wiki</a>, so feel free to refer to it.

Moderator: Moderators

Locked
TasMan
Posts: 196
Joined: 2003-01-03 08:31
Location: Canada
Contact:

$ and | Character Escaping

Post by TasMan » 2003-03-04 16:39

We should try to set a standard for character escaping in the main chat and private messages....

I currently use (though I need to change some things - ex useless $ changing in the main) /%DCN036%/ for a $ and /%DCN124%/ for a | (very bloated). oDC++ uses something different, I haven't a clue about BCDC++, and I'm too lazy to check Open Direct Connect....

I know my way is quite bloated, but then again, odds are people won't being using it for usual chatting.


So what's the standard going to be eh? I'll support it whatever we decide on....

sandos
Posts: 186
Joined: 2003-01-05 10:16
Contact:

Post by sandos » 2003-03-04 17:48

Something like \u0000 for full unicode support would be nice. (Taken from Java) Shouldnt happen very often that people write that in a chat either.

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 17:15

Post by arnetheduck » 2003-03-05 06:43

I added the html style of escaping, i e &#124; to my local repository ...this can be used for the strange unicode characters as well (in theory), although dc++ will just accept the $ and | in the beginning...comments?

sandos
Posts: 186
Joined: 2003-01-05 10:16
Contact:

Post by sandos » 2003-03-05 07:08

Fine by me ;)

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-03-05 10:04

how will this be implemented?

only convert on "&#[0-9]+;"?
or try to make something out of every "&[^;]*;"?
i.e. we won't be needing "&", or?
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

TasMan
Posts: 196
Joined: 2003-01-03 08:31
Location: Canada
Contact:

Post by TasMan » 2003-03-05 14:21

although dc++ will just accept the $ and | in the beginning
SDC can read $ in the main and pms fine, but how did you manage to get it to read | without escaping? After all, that should denote a new message right?

And another point is that some clients (the one we all know and love - NMDC) won't see the message (or part of) if there is a $ or a |. So with escaping, that problem would be avoided.

TasMan
Posts: 196
Joined: 2003-01-03 08:31
Location: Canada
Contact:

Post by TasMan » 2003-03-05 14:22

oh and I would be fine with the standard html way...

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 17:15

Post by arnetheduck » 2003-03-07 06:28

TasMan wrote:
although dc++ will just accept the $ and | in the beginning
SDC can read $ in the main and pms fine, but how did you manage to get it to read | without escaping? After all, that should denote a new message right?
by escaping? =) i e dc++ will not support the whole html &-escaping scheme...

ender
Posts: 224
Joined: 2003-01-03 17:47

Post by ender » 2003-03-07 14:04

$ in the main chat does not need to be escaped (and when chatting with DC++ user, it doesn't have to be escaped in PMs either)... however, | must always be escaped. I know that a few programs already do the /%DCN%/ escaping (the same as in $Key), and as that kind of escaping is kind of 'standard' in DC (at least for the key), IMO, it should be adopted to the chat & PMs...

TasMan
Posts: 196
Joined: 2003-01-03 08:31
Location: Canada
Contact:

Post by TasMan » 2003-03-07 19:28

Hehe oh I thought you meant WITHOUT escaping arne....I misread it. You meant to start with, you will only have $ and |...

Well ender, that's what I'm using currently....though I'm a little more bent towards the HTML standards right now. Slightly smaller at least :P (alright I like fast and small - lol and I program in VB)

Opera
Programmer
Posts: 15
Joined: 2003-02-21 13:45

Post by Opera » 2003-03-08 11:37

I think we should let users use whatever client they prefer, and sollutions with long escapes looks very weird for others. My way might not be the best, but it escapes $ to [§] and | to [¦]. This way it doesn't look too weird for users on clients that doesn't escape this way. And they most defintely will understand the sentance.

Opera
Creator of the dc++ fork, oDC found at:
http://gempond.com/odc

sandos
Posts: 186
Joined: 2003-01-05 10:16
Contact:

Post by sandos » 2003-03-08 16:40

Opera wrote:I think we should let users use whatever client they prefer, and sollutions with long escapes looks very weird for others. My way might not be the best, but it escapes $ to [§] and | to [¦]. This way it doesn't look too weird for users on clients that doesn't escape this way. And they most defintely will understand the sentance.

Opera
That is a very good point, imho.

TasMan
Posts: 196
Joined: 2003-01-03 08:31
Location: Canada
Contact:

Post by TasMan » 2003-03-09 14:44

So which one will we decide upon? I don't really care which, just as long as we decide on a standard :P .

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-03-10 23:14

TasMan wrote:So which one will we decide upon? I don't really care which, just as long as we decide on a standard :P .
Well, won't whatever gets implemented in DC++ first become standard? And since arne said he added it, it sounds like the decision is made. :-D

Dj_Offset
Posts: 48
Joined: 2003-02-22 19:22
Location: Oslo, Norway
Contact:

Post by Dj_Offset » 2003-03-11 04:00

Okay, let's do it the HTML-way, will the & be escaped or what happens if someone wants to write exactly &#124; in a chat session?
If not, you've just moved the problem around, not removed it...
I wrote QuickDC - A DC++ compatible client for Linux and FreeBSD.

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2003-03-11 04:49

i would have gone for the irc-way of escaping CRLF, but i guess its to late todo it now in dc... so well.. i don't care.. i don't see the point of escaping $.
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

Dj_Offset
Posts: 48
Joined: 2003-02-22 19:22
Location: Oslo, Norway
Contact:

Post by Dj_Offset » 2003-03-11 04:52

ivulfusbar wrote:i would have gone for the irc-way of escaping CRLF, but i guess its to late todo it now in dc... so well.. i don't care.. i don't see the point of escaping $.
No not really for chat atleast. But the | (pipe) must be escaped
(I think it's annoying to not have a pipe, but then again... I'm a UNIX dude...)
I wrote QuickDC - A DC++ compatible client for Linux and FreeBSD.

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2003-03-11 05:06

yes, i miss to be able to write one-linears and send it to people who are new in the *nix world.... doesn't irc use \001 or \002 or something for escaping? don't remember right now. Well that would probably not work in dc beacuse most clients would print those []-boxes for none-printable chars.
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 17:15

Post by arnetheduck » 2003-03-11 07:54

Any solution chosen will of course have its own limitations on what you can and cannot write...so far, I haven't added &-escaping of the &, mainly because I anticipate that the string &#124; is not one the average dc++ chatter would use...opera has got a valid point in that it's important to let the old clients at least see something, but with the html thing, in the future, we could add more strange characters, should I ever decide to support unicode in some way...the dcn goes down because of the same limitation, it only allows for 999 character substitutions, and is plain ugly...

The only thing I can't decide upon is whether to send the $ clean or escaped...

ender
Posts: 224
Joined: 2003-01-03 17:47

Post by ender » 2003-03-11 08:36

Send $ clean in main chat. I haven't seen a client that would have problems with unescaped $ in the main chat...

TasMan
Posts: 196
Joined: 2003-01-03 08:31
Location: Canada
Contact:

Post by TasMan » 2003-03-11 14:43

* You can now use $ and | in the chat. DC++ uses the HTML standard &#36; and &#124; to replace them...some people
might not like this because it's different than the escape sequence used in the lock, but I prefer a standard way
of escaping that's not limited to numbers below 999...later on, perhaps I'll add full &-escaping support so that
people will be able to send all kinds of strange characters. The same escpace sequences are used in the description
and email.
Looks like you forced my hand :) ....I'll change my escaping to this in the next release....

bobaxos
Posts: 10
Joined: 2003-02-13 18:19

Post by bobaxos » 2003-03-11 19:45

it seems (though i havent tested) that you can send both $ and | to the main chat using DC++ but i am not sure if everyone can see this as i havent upgraded yet but i will when i get home.

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 17:15

Post by arnetheduck » 2003-03-13 06:35

Nah, in the end I escaped $ as well, so that the same escapes can be used in the description...

Locked