29.07.2011 - fundamental new
This commit is contained in:
22
picodec.cpp
Normal file
22
picodec.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "picodec.h"
|
||||
|
||||
|
||||
PIStringList PICodec::availableCodecs() {
|
||||
exec("iconv", "-l");
|
||||
waitForFinish();
|
||||
PIString str(readOutput());
|
||||
str.cutLeft(str.find("\n "));
|
||||
str.replaceAll("\n", "");
|
||||
return str.split("//");
|
||||
}
|
||||
|
||||
|
||||
PIByteArray PICodec::exec_iconv(const PIString & from, const PIString & to, const PIByteArray & str) {
|
||||
tf.open();
|
||||
tf.clear();
|
||||
tf << str;
|
||||
tf.close();
|
||||
exec("iconv", ("-f=" + from), ("-t=" + to), tf.path());
|
||||
waitForFinish();
|
||||
return readOutput();
|
||||
}
|
||||
Reference in New Issue
Block a user