You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
559 B
27 lines
559 B
15 years ago
|
#include "qutf7codec.h"
|
||
|
#include "qutf7codec.cpp"
|
||
15 years ago
|
#include <tqtextstream.h>
|
||
15 years ago
|
#include <string.h>
|
||
|
#include <assert.h>
|
||
|
|
||
|
int main( int argc, char * argv[] ) {
|
||
|
if ( argc == 1 ) {
|
||
14 years ago
|
(void)new TQUtf7Codec;
|
||
15 years ago
|
|
||
15 years ago
|
TQTextCodec * codec = TQTextCodec::codecForName("utf-7");
|
||
15 years ago
|
assert(codec);
|
||
|
|
||
15 years ago
|
TQTextIStream my_cin(stdin);
|
||
15 years ago
|
my_cin.setCodec(codec);
|
||
|
|
||
15 years ago
|
TQTextOStream my_cout(stdout);
|
||
15 years ago
|
|
||
15 years ago
|
TQString buffer = my_cin.read();
|
||
15 years ago
|
|
||
|
my_cout << buffer;
|
||
|
} else {
|
||
|
qWarning("usage: testutf7decoder string_to_decode\n");
|
||
|
}
|
||
15 years ago
|
TQTextCodec::deleteAllCodecs();
|
||
15 years ago
|
}
|