Бака Гайдзин píše v St 10. 02. 2010 v 18:03 +0200:
> 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.
>  

This is actually very very simple:

var result = (string) message.response_body.data;

Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy

_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to