[Vala] [Soup] How to convert uint8[] to string?



Hi!

In the new version of Vala (0.7.10) Soup.Message.response_body.data
returns uint8[] instead string, like in older versions. Is there any
standart way to convert this value to string?
I wrote this piece of code, but it is very ugly and slow, I think:

var session = new SessionAsync();
var message = new Message("GET", "http://meta.ua";);
session.send_message(message);

string result = "";
for(int i = 0; i < message.response_body.length; i++) {
        result += ((char)message.response_body.data[i]).to_string();
}

Hope for your suggestion.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]