Hi, I think I ran into a bug working on a pure UTF-8 web site. Command [::rivet::upload filename] calls internally

int TclWeb_UploadFilename(Tcl_Obj *filename, TclWebRequest *req)
{
    Tcl_SetStringObj(filename,
             TclWeb_StringToUtf(req->upload->filename,req), -1);
    return TCL_OK;
}

which converts a UTF-8 encoded filename in a new UTF-8 string. The bug hit hard at first because files having names with character such as 'à' or 'è' etc. created calling [::rivet::upload save ...] look correct on the file system but any attempt to manipulate it subsequently (copying it, changing permissions..) using the same Tcl variable resulted in a mere 'file not found' error. And there reason was that '::rivet::upload save' copies the file with the original unconverted name thus concealing the fact that the string returned by 'filename' was different. A workaround is re-converting the filename from utf-8 before any file manipulation, but it's an inconsistent behavior. Fixing it without breaking existing software is hard, so I will try to figure it out but unless I come up with a good solution, I would confine any code breaking change to rivet 3.0

 -- Massimo




---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to