Re: Avoiding string break...



I think you don't need base64 at all. It appears that there is a simple bug in your code where you convert from string object to raw data, or vice-versa.

So the easiest is probably if you post the relevant excerpt of your source code, the bug should be easy to find.





----- Original Message ----
From: Glus Xof <gtglus gmail com>
To: michi7x7 <mailing-lists michi7x7 de>
Cc: gtkmm-list gnome org
Sent: Mon, 3 May, 2010 21:01:07
Subject: Re: Avoiding string break...

2010/5/3 michi7x7 <mailing-lists michi7x7 de>:
> ----- Original Message ----
>>>
>>> Does exist any foreseen solution to avoid the classical string break
>>> by the '\0' character ?
>>>
>>> (I use Gio::receive&  Gio::send()...)
>>>
>>> Glus
>>>
>
> If you use a std::string the string should be able to contain '\0'.
>
> For example:
>
> Gio::IOStream io_stream;
> Glib::RefPtr<Gio::Outputstream> out = io_stream->get_output_stream();
> std::string str("ABC\0DEF");
> out->send(str);
>
> But I'm not sure about that...

Excuse-me, I'm using Gio::Socket::receive() & Gio::Socket::send(), not
Gio::receive() & Gio::send()...

Both Gio::Socket::receive() & Gio::Socket::send() take as a chain
types "char *" and  "const gchar *" values, respectively, but not
std::string (right now, I get the values using the c_str() method...)

The tests done show me that in most cases all works fine, but sometimes, when

"subchain1\0subchain2"

only retrive "subchain1"..

Glus
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list






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