Hi Gustaf,
Yes, that looks great. Along with the ns_urlencode equivalent I think it
would solve our problem.
Thanks very much for the reply.

- David

On 30 October 2012 14:44, Gustaf Neumann wrote:

>  Dear David,
>
> would the following change help you?
>
> Before i finalize this change (do this on encode as well, add to
> documentation, etc.),
> was this omitted on purpose in naviserver?
>
> -gustaf neumann
>
> --- a/nsd/urlencode.c Mon Oct 29 13:46:08 2012 +0100
> +++ b/nsd/urlencode.c Tue Oct 30 15:41:06 2012 +0100
> @@ -504,8 +504,9 @@
>  NsTclUrlDecodeObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj 
> *CONST objv[])
>  {
>      Ns_DString   ds;
> -    char        *string;
> +    char        *string, *charset = NULL;
>      int          part = 'q';
> +    Tcl_Encoding encoding = NULL;
>
>      Ns_ObjvTable parts[] = {
>          {"query",    'q'},
> @@ -514,7 +515,8 @@
>      };
>      Ns_ObjvSpec opts[] = {
>          {"-part",    Ns_ObjvIndex,   &part,   &parts},
> -        {"--",       Ns_ObjvBreak,    NULL,    NULL},
> +        {"-charset", Ns_ObjvString,  &charset, NULL},
> +        {"--",       Ns_ObjvBreak,   NULL,    NULL},
>          {NULL, NULL, NULL, NULL}
>      };
>      Ns_ObjvSpec args[] = {
> @@ -526,7 +528,11 @@
>      }
>
>      Ns_DStringInit(&ds);
> -    UrlDecode(&ds, string, NULL, part);
> +    if (charset) {
> +        encoding = Ns_GetUrlEncoding(charset);
> +    }
> +
> +    UrlDecode(&ds, string, encoding, part);
>      Tcl_DStringResult(interp, &ds);
>
>      return TCL_OK;
>
>
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to