1

Topic: Encoding problem. Additional characters not working in ASP.NET Plugin

We encountered a bug due to usage of German umlaut in Filenames and Folders (MCImageManger and MCFileManager). And we found a Solution!

ASP.NET throws a FileNotFound Exception, because the encoding of the query string is wrong. (ü -> %FC -> is encoded to %ufff)

Plugins\imagemanager\stream\default.aspx: Line: 57 
man.DispatchEvent(EventType.Stream, cmd, Request.QueryString);

The original query string captured by Fiddler results in a HTTP 500 Error.

GET /tinymce/plugins/imagemanager/stream/default.aspx?cmd=im.thumb&path=%7B0%7D/cms/Animation-f%FCr-web.gif&u=99676 HTTP/1.1

If we change the query string in Fiddler, (%FC -> %C3%BC) we get a HTTP 200 OK from our Webserver.

GET /tinymce/plugins/imagemanager/stream/default.aspx?cmd=im.thumb&path=%7B0%7D/cms/Animation-f%C3%BCr-web.gif&u=99676 HTTP/1.1

If we change the JS encoding function from 'escape' to 'encodeURIComponents’, the thumbnail generator works correctly.

//old
thumburl : '../../stream/default.aspx?cmd=im.thumb&path=' + escape(r.path) + '&u=' + r.size,
//new
thumburl : '../../stream/default.aspx?cmd=im.thumb&path=' + encodeURIComponent (r.path) + '&u=' + r.size,

Microsoft also recommends using "encodeURIComponent" with ASP.NET.

Could you please implement an entry in your configuration, so that it’s possible to switch between the different encodings?

2

Re: Encoding problem. Additional characters not working in ASP.NET Plugin

Yes. .NET if utf compatible by default. Think we have used escape due to crappy PHP without proper UTF support. Will look into this for future versions.

Best regards,
Spocke - Main developer of TinyMCE