Coder Social home page Coder Social logo

qt-quoted-printable's Introduction

Quoted-Printable Encoder/Decoder for Qt

This project contains an encoder and a decoder for Quoted-Printable encoding described in RCF 2045.

##Examples The following example will show how to encode and decode an unicode text:

#include <QApplication>
#include "quotedprintable.h"

#include <iostream>

int main(int argc, char **argv)
{
    QApplication(argc, argv);

    QString text ("Some unicode text: \n" \
                  "Hungarian text: Jó reggelt kívánok!\n" \
                  "Chinese text: 您 好,世 界!\n" \
                  "Math operators :  ⋐ ⋑ ⋒ ⋓ ⋔ ⋕ ⋖⋗ ⋘ ⋙ ⋚ ⋛ ⋜ ⋝ ⋞ ⋟\n");

    std::cout << "=== Original Text ===\n";
    std::cout << text.toStdString();

    QString encoded = QuotedPrintable::encode(text.toAscii());

    std::cout << "\n=== Quoted-Printable Encoded Text ===\n";
    std::cout << encoded.toStdString();

    QString decoded = QuotedPrintable::decode(encoded);

    std::cout << "\n\n=== Decoded Text ===\n";
    std::cout << decoded.toStdString();

    return 0;
}

The program's output will be:

=== Original Text ===
Some unicode text:
Hungarian text: Jó reggelt kívánok!
Chinese text: 您 好,世 界!
Math operators :  ⋐ ⋑ ⋒ ⋓ ⋔ ⋕ ⋖⋗ ⋘ ⋙ ⋚ ⋛ ⋜ ⋝ ⋞ ⋟

=== Quoted-Printable Encoded Text ===
Some unicode text: =0AHungarian text: J=C3=B3 reggelt k=C3=ADv=C3=A1nok!=0AChinese text: =E6=82=A8 =E5=A5=BD=EF=BC=8C=E4=B8=96 =E7=95=8C=EF=BC=81=0AMath operators :  =E2=8B=90 =E2=8B=91 =E2=8B=92 =E2=8B=93 =E2=8B=94 =E2=8B=95 =E2=8B=96=E2=8B=97 =E2=8B=98 =E2=8B=99 =E2=8B=9A =E2=8B=9B =E2=8B=9C =E2=8B=9D =E2=8B=9E =E2=8B=9F=0A

=== Decoded Text ===
Some unicode text:
Hungarian text: Jó reggelt kívánok!
Chinese text: 您 好,世 界!
Math operators :  ⋐ ⋑ ⋒ ⋓ ⋔ ⋕ ⋖⋗ ⋘ ⋙ ⋚ ⋛ ⋜ ⋝ ⋞ ⋟

##License

This project is released under LGPL, version 2.1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.