After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607625 - Problem with libsoup and strings with odd-encodings?
Problem with libsoup and strings with odd-encodings?
Status: RESOLVED OBSOLETE
Product: seed
Classification: Bindings
Component: libseed
git master
Other All
: Normal normal
: ---
Assigned To: seed-maint
seed-maint
Depends on:
Blocks:
 
 
Reported: 2010-01-21 03:18 UTC by Tim Horton
Modified: 2021-05-25 17:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim Horton 2010-01-21 03:18:23 UTC
The following code should print the contents of the site (and works for the non-big5 http://www.google.com/), but it instead prints just the length/status. A similar C version works just fine...

Gtk = imports.gi.Gtk;
Soup = imports.gi.Soup;

var session = new Soup.SessionAsync();

// Soup.URI is a struct.
var uri = new Soup.URI.c_new("http://www.google.com.hk/");

var request = new Soup.Message({method:"GET", uri:uri});


var status = session.queue_message(request, function(ses,msg) {
  Seed.print(msg.response_body.length); // prints 8062
  Seed.print(msg.response_body.data); // prints empty string.
  Seed.print(msg.status_code); // prints 200
 // Seed.print(msg.request_body.data);
});


Gtk.init(0, null);

Gtk.main();
Comment 1 Dan Winship 2010-08-27 16:33:39 UTC
This is a known bug in libsoup-via-introspection; we're currently calling some strings "utf8", but really they're unknown-encoding and ought to be considered byte arrays. Except then they're harder to deal with in the very common ASCII-only case... I haven't quite figured out what I'm going to do here...
Comment 2 Alan Knowles 2010-08-27 22:58:21 UTC
data should be tagged as 
(array) (element-type char)

need to check http://live.gnome.org/GObjectIntrospection/Annotations and the source to see how struct info can handle the length property..
Comment 3 André Klapper 2021-05-25 17:32:14 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new enhancement request ticket at
  https://gitlab.gnome.org/GNOME/seed/-/issues/

Thank you for your understanding and your help.