From: Gustaf N. <ne...@wu...> - 2022-05-14 07:59:29
|
Hi Dave, Maybe i find time slots before the release for easing this process, e.g.m providing a flag for providing a charset for "ns_getform" in case it fails, "ns_urldecode" has already a "-charset" flag) but i have not checked the details how complex this is. all the best -g On 13.05.22 10:32, David Osborne wrote: > Thanks Gustaf, > > I didn't pick up that your latest commit makes it possible to catch > and handle an encoding error now. > Thanks - we'll try to address the issue that way. > Regards, > Dave > > On Thu, 12 May 2022 at 12:27, Gustaf Neumann <ne...@wu...> wrote: > > Dear David, > > NaviServer is less strict than the W3C-document, since it does not > send automatically an error back. > Such invalid characters can show up during decode operations of > ns_urldecode and ns_getform. > So, a custom application can catch exceptions and try alternative > encodings if necessary. > > Since there is currently a large refactoring concerning Unicode > handling going on for > the Tcl community (with potentially different handling in Tcl 8.6, > 8.7 and 9.0, ... hopefully > there will be full support for Unicode already in Tcl 8.7, the > voting is happening right now) > it is not a good idea to come up with a special handling by > NaviServer. These byte sequences > have to be processed sooner or later by Tcl in various versions... > > I do not think it is a good idea to swallow incorrect incoming > data by transforming this > on the fly, this will cause sooner or later user concerns (e.g. > "why is this funny character > in the user name", ...) When the legacy application sends e.g. > iso8859 encoded data, then it > should set the appropriate charset, and it will be properly > converted by NaviServer. > > If for whatever reason this is not feasible to get a proper > charset, then the NaviServer > approach allows to make a second attempt of decoding the data with > a different charset. > > all the best > > -gn > > > > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel -- Univ.Prof. Dr. Gustaf Neumann Head of the Institute of Information Systems and New Media of Vienna University of Economics and Business Program Director of MSc "Information Systems" |