notepad++ - How to encode a text string into QP?

07
2014-07
  • sammyg

    I would like to encode some basic text strings into QP. I have tested several online encoders on the web, and none of them worked. One of them can be found at Webatic. I can use it to decode QP into something readable, if I already have something encoded in QP. But it doesn't work for me the other way around. I'm not sure why?... something wrong with the PHP code on the site? Or am I doing it wrong?

    I don't see why all the web sites I tested would have this problem. Perhaps it is generally harder to encode than to decode QP? I had UTF-8 character set both on the site and in Firefox 27 browser.

    Here is an example of decoding QP.

    QP:
    =54=68=6F=6D=61=73
    
    Graphic character:
    Thomas
    

    But when going in the opposite direction, i.e. encoding "Thomas" into QP it only prints out "Thomas". I'm referring to the web tool over at Webatic here. But I tested several others and none of them are doing what they are supposed to.

    Can this be done in Notepad++ instead of relying on web based tools?

  • Answers
  • Nikolay

    Thomas does not need to be encoded. It contains only ASCII printable characters and thus can be transmitted over the network without problems. That is why you are getting Thomas as output. So there is no problem with the site.

    Quoted-printable encoding is intended to represent non-ASCII characters by combination of ASCII characters to allow transmission of strings with non-ASCII characters over the network safely.

    As example here is Russian word Привет (hello) represented as Quoted-printable string (UTF-8) =D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82 with help of the Webatic site.

    More data on Quoted-Printable and why it was created here and on Wikipedia.

    As per Sourceforge there is support for quoted-printable encoding in Notepad++ since release 4.8.5 (in MIME Tools plugin).


  • Related Question

    Loading a chinese encoding file in vim, conversion errors
  • Full Decent

    I can view http://hosting2.phor.net/~bolomi/ and save this to a file. In Chrome, I can view source and see the title of the page is 波羅蜜. If I open the saved file in vim to edit, I see question marks for those characters. Then if I :set encoding=gb2312 I will see the first two characters and then question marks. If, instead, I do :e ++enc=gb2312 %:p I will see the middle character.

    After the file is open (because I use MacVim and Fetch opens the file for me automatically) what is the correct workflow to edit this file?


  • Related Answers
  • Full Decent

    gb2312 only does simplified characters.

    Firefox, Mozilla, and python2-chardet-2.0.1 all lie and say this is gb2312, but since it has traditional characters, the charset needed is gb18030.

    So: if it looks like a duck, quacks like a duck, smells like a duck, and tastes like a duck... open the file with hexdump and read the codepage definition file.

  • redacted

    I have vim set to use UTF-8, as as far as I can see the characters correctly. Maybe try

    set encoding=utf-8