BackSlashes dissapearing.

ChipDeath

Splendid
May 16, 2002
4,307
0
22,790
Really quite an irrelevant bug, so stick it WAY WAY WAAAAY down the list...

Well, for one thing you need two backslashes (\s) for each one you actually want displayed, but that would seem to be the case everywhere.

If you want any in your sig, when you go in to edit your sig again later under profile options, it's replaced all the double \s with single ones, so if you amend something else in the sig it'll effectively delete them altogether, so you need to always remember to replace the single ones with \\ every time you alter some minor detail...

For some reason, the single backslash after the open bracket in my sig has not suffered this problem. Just confirmed that with some test posts. If I edit my sig now, it'll have deleted all the double \s I was forced to use, apart from the one in the first line (bunny ears).

I can cope with it using them as some form of weird 'take next char as literal' operator - useful for telling people how to use tags and suchlike, but why the inconsistent behaviour?
 

slvr_phoenix

Splendid
Dec 31, 2007
6,223
1
25,780
In a lot of different programming languages there are different special-character handling sequences in strings that use the backslash. \n for newline, \r for carriage return, \f for line feed, \t for tab, etc. The result of this is that to enter a single backslash you actually have to use a double-backslash \\ then, and single backslashes that don't complete a special character combo often end up considered as errors and get removed.

So chances are that this bug is just related to something in the forum's code processing the text you're entering. It is however quite interesting to see this happening.
 

ChipDeath

Splendid
May 16, 2002
4,307
0
22,790
I had assumed as much (I have sufficient C knowledge to know this..), but that still doesn't explain why bunny's ears are an exception, and then only in my sig... :?
 

slvr_phoenix

Splendid
Dec 31, 2007
6,223
1
25,780
I had assumed as much (I have sufficient C knowledge to know this..)
Sorry, forgot. :oops:

but that still doesn't explain why bunny's ears are an exception, and then only in my sig... :?
I'd say because the sigs aren't handled by the same code. :wink: It sounds obvious and stupid, but the sigs are handled seperately from the posts. So the sigs must go through different processing.

What I also find funny is that the code tag, which I'd thought was designed to never alter the text inside of it, is also converting double backslashes to single backslashes. So I'd guess this is a more fundamental problem.

I'd guess that it's either at the initial point of entry (making a string of the text out in the post's edit box) or the last point of entry (saving the string into the databse).

Since the sigs aren't affected by this, comparing the code between these two operations would probably be where I'd start. :)
 

ChipDeath

Splendid
May 16, 2002
4,307
0
22,790
But the Sigs are affected... I have the problems with the backslashes in the last line of the sig too... You'd be able to see that if it stored the older sigs with the posts I guess... Kinda a shame it doesn't, but I know how such an apparently small thing can have a large cumulative effect on database size of course, so I understand it...

The only backslash that is unaffected is the first one in my sig.. Multiple times I've gone in to edit it now, and I need to play with the \s at the bottom of it (under the pan), but I've never had to change the ears.. Even though they're all in the same
Code:
 block.  The entire [code] block is nested inside a [size=6] block too, because I initially didn't realise the [code] tags would ignore it, and am now too wary of changing it to remove them... :oops:   It's the first one's immunity that I find [i]really[/i] puzzling.... :?
 

slvr_phoenix

Splendid
Dec 31, 2007
6,223
1
25,780
Wow. That's really weird. :eek:

When I tested it, I only tested one use, so it had looked like the autosigs wasn't affected. But you're saing that it is only the first use in the autosigs that isn't affected, and the rest are? Freaky.

It's a good thing that we're not all computer programmers here, because if we were, that'd make posting code very annoying. 8O