Re: URL encoding feature
- From: Ahmad Baitalmal <ahmad bitbuilder com>
- To: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: URL encoding feature
- Date: Sat, 02 Sep 2000 15:11:54 -0700
Ahmad Baitalmal wrote:
39B17942.3050906@bitbuilder.com">I've ran into this problem
a few times so I decided to fix it and send it in. I though something like
this would be found in glib, but I didn't find it anywhere. gtkhtml uses
libwww and it's a big mess for what I wanted to do.
So
gchar* url_encode( gchar* source )
source : The raw URL string.
returns: A new allocated URL encoded string, must free with g_free when done.
This function follows RFC 2396 (Query Component)
Example:
tts = g_strdup("www.BitBuilder.com/query.php?text=Abbas Bin Fernas, huh?" );
tts = url_encode( tts );
g_print("%s\n", tts);
g_free( tts );
The example above is a bit misleading. You should not encode the WHOLE url.
Just the text part. The best web server on the planet (a.k.a. Apache) will
not response if you send spaces in query variables. So you must encode the
variable values only "Abbas Bin Fernas, huh?".
Take care,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]