Omnimaga

Omnimaga => Discontinued => Our Projects => OmnomIRC Development => Topic started by: calcdude84se on April 30, 2011, 12:57:59 am

Title: Lines with tildes ('~') in them are not displayed
Post by: calcdude84se on April 30, 2011, 12:57:59 am
Yeah. :P
Edit: it appears inconsistent. For example, "te~st" never displays, while "k~k" does.
Title: Re: Normal (non-'/me') lines with tildes ('~') in them are not displayed
Post by: Juju on April 30, 2011, 01:02:00 am
Odd. It works half of the time, found out that if the 3rd character is a position of the tilde is a multiple of 3 it doesn't work.
Title: Re: Normal (non-'/me') lines with tildes ('~') in them are not displayed
Post by: calcdude84se on April 30, 2011, 01:09:40 am
Also, don't count spaces and index from 1.
Title: Re: Normal (non-'/me') lines with tildes ('~') in them are not displayed
Post by: Netham45 on April 30, 2011, 04:02:45 pm
wut

How do you guys find these? :|

The only thing I can think of is some sort of flaw in the base64 lib I'm using, I'll read over it..
Title: Re: Normal (non-'/me') lines with tildes ('~') in them are not displayed
Post by: calcdude84se on May 01, 2011, 03:57:11 pm
I typed a message that had a tilde in the bad position, and it didn't display. I tried it a couple more times and it still didn't work, at which point I made this topic. Juju and I then proceeded to test it ;D
Edit: Oh, and good luck fixing it, of course :)
Title: Lines with tildes ('~') in them are not displayed
Post by: Deep Toaster on May 01, 2011, 04:03:23 pm
I love these hidden tricks :D

The only thing I can think of is some sort of flaw in the base64 lib I'm using, I'll read over it..

Every third? Sounds like it.

EDIT: Always works for me ???/me ~test
/me t~est
/me te~st
/me tes~t
/me test~

EDIT2: Oh, non-/me. Never mind.

EDIT3: Still works ???
~test
t~est
te~st
tes~t
test~

EDIT4: Oh, OmnomIRC. Never mind.
Title: Re: Normal (non-'/me') lines with tildes ('~') in them are not displayed
Post by: ruler501 on May 01, 2011, 04:08:50 pm
I tested this and here are my resuts

te~st works if not sent through omnomIRC(I used XChat) and it will display on omnomirc
Title: Re: Normal (non-'/me') lines with tildes ('~') in them are not displayed
Post by: calcdude84se on May 01, 2011, 04:11:04 pm
Stop confusing us, Deep :P
I'll be interested to know just what went wrong.
By the way, Deep Thought, what does the number three have to do with a base64 lib?
Edit: Ruler, yep, from a normal client OmnomIRC receives the lines just fine :) It can't send them, though.
Title: Lines with tildes ('~') in them are not displayed
Post by: Deep Toaster on May 01, 2011, 04:12:54 pm
By the way, Deep Thought, what does the number three have to do with a base64 lib?

In base64, each group (triplet) of three ASCII characters is represented as four B64 digits.

http://en.wikipedia.org/wiki/Base64#Examples
Title: Re: Normal (non-'/me') lines with tildes ('~') in them are not displayed
Post by: calcdude84se on May 01, 2011, 04:14:49 pm
Oh, I see. Silly me :P (* calcdude needs to think for himself a bit more...)
I wonder if any other characters are affected...
Title: Lines with tildes ('~') in them are not displayed
Post by: Deep Toaster on May 01, 2011, 04:21:03 pm
Er, it happens in /me lines too :-
Title: Re: Lines with tildes ('~') in them are not displayed
Post by: calcdude84se on May 01, 2011, 04:23:03 pm
So it does. I just didn't realize it. Fixing the topic title, here I go!
Edit: Done.
Title: Re: Lines with tildes ('~') in them are not displayed
Post by: Deep Toaster on May 01, 2011, 04:25:39 pm
Guess it's just tilde... What does $7E have to do with anything? O.o
Title: Re: Lines with tildes ('~') in them are not displayed
Post by: Jim Bauwens on May 01, 2011, 05:28:14 pm
~ is the last displayable char in the (standard) ascii set. Maybe somewhere there is an error in conversion code that makes it go out of 'bounds'.
Title: Re: Lines with tildes ('~') in them are not displayed
Post by: Deep Toaster on May 01, 2011, 05:29:59 pm
I can type รกรกรก with no problem though...
Title: Re: Lines with tildes ('~') in them are not displayed
Post by: Jim Bauwens on May 01, 2011, 05:34:39 pm
Ok, other theory: maybe durring the process, 1 is added to the char (to be subtracted later). If this is so, 126 becomes 127, which is the control character DEL. Maybe this has something to do with it?
Anyway, its a weird bug.
Title: Re: Lines with tildes ('~') in them are not displayed
Post by: Netham45 on May 02, 2011, 02:59:40 am
Here's what was happening:
Base64 has + as a valid character.
+ is not valid for URLs.
~ just happens to have a + in it, if it's in a specific spot.


Solution:
Find/replace + for - on send, as - is a valid URL char and not used in Base64.
Find/replace - for + on receive, then base64 decode.

Problem solved.