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



Бака Гайдзин wrote:
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?

In this specific case you should call the flatten() method of
Soup.MessageBody, because the data might not end with '\0':

http://library.gnome.org/devel/libsoup/stable/libsoup-24-SoupMessageBody.html#soup-message-body-flatten

        string s = message.response_body.flatten().data


Best regards,

Frederik



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