Re: QByteArray to QString
hi..
you can use this function below to convert to string.
public String Byte2Array(Byte[] b){
String str="";
for(int i=0;i<=b.length(),i++){
str = str + (char)byte[i];
}
print(str);
}
Re: QByteArray to QString
Do you need that byte array? or is it just for reading the file?
I suggest you to use QTextStream to read the file (with a proper encoding). Then you have the content in a QString which you can convert to a byte array if needed.
Re: QByteArray to QString
You should start your QByteArray with a unicode BOM, that way QString can detect the proper encoding correctly.
ketan007: That function is built into QString.