Project

General

Profile

Bug #158

Handle ASCII control codes sanely

Added by Sputnick over 14 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Quassel Core
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Version:
0.3.0.x
OS:
Any

Description

Codes below 0x20 are ASCII control codes. If somebody send one of these via IRC (that just happened for some strange reason), QString converts those to funny-looking characters.

We should think about a way to display these more sanely, maybe using the "standard" notation ^H for backspace etc. (but be sure to distinguish that from somebody sending ^H literally).

0001-An-UTF-8-character-is-now-used-to-represent-the-ASCI.patch (3.54 KB) 0001-An-UTF-8-character-is-now-used-to-represent-the-ASCI.patch Patch to fix the issue by replacing the control characters by their UTF-8 representation. Gallaecio, 12/01/2012 06:11 PM

History

#1 Updated by Sputnick about 14 years ago

  • Priority changed from High to Normal

#2 Updated by Gallaecio over 10 years ago

I was going to give this a try, but I’ve not been able to reproduce it… …because I could not figure out how to write ASCII characters in Linux given their value.

Anyway, since it’s been 4 years since the last update, is this bug still valid?

#3 Updated by Anonymous over 10 years ago

  • Version set to 0.8-pre
  • OS set to Any

Yes, this is still valid; Easiest way for me is to fire up ii and e.g. `echo -e 'foo\010bar\007' >in`.

#4 Updated by Anonymous over 10 years ago

  • Target version set to Some future release

#5 Updated by Gallaecio about 10 years ago

I’ve written a patch to replace the control characters by an UTF-8 character that represents them visually.

Also, these are in-depth details on the steps to reproduce the issue, just in case:

1. From Quassel, connect to the room #quassel-issue158 in FreeNode.
2. Install ‘ii’.
3. Run it. For example:

    $ ii -i . -s 83.170.94.214 -p 6665 -n QuasselIssue158

4. From a different terminal, enter the directory generated (‘83.170.94.214’) and run:

    $ echo "/j #quassel-issue158" > in
    $ cd \#quassel-issue158/
    $ echo -e "foo\007bar\010" > in

5. Watch the result in Quassel.

Expected result: meaninful representation of the codes.
Actual result: meaningless characters.

To print the whole list of control codes, use the following script:

    for i in {0..31} 127
    do
        hex=$(echo ""$i" "16" o p" | dc)
        echo -e "$(printf "%03x\n" 0x$hex). foo\\x$(printf "%02x" 0x$hex)bar" > "$1"; sleep 1;
    done

Run it followed by the path to the target ‘in’ file:

    $ ./script.sh "83.170.94.214/#quassel-issue158/in" 

#6 Updated by Gallaecio about 10 years ago

Ups, I see there is already a fix, so nevermind about the patch.

#7 Updated by Anonymous almost 10 years ago

  • Status changed from New to Resolved
  • Assignee set to Anonymous
  • Target version changed from Some future release to 0.9.0
  • Version changed from 0.8-pre to 0.3.0.x

Also available in: Atom PDF