ThemeResource with non-ASCII characters (e.g. German umlaut)

Hi,

I have problems when the resourceId of a ThemeResource (e.g. the filename of an image) contains some non-ASCII characters (e.g. a German umlaut):
E.g. the icon does not appear for the PNG file ‘thüringen.png’.
comboBox.setItemIcon(itemId, new ThemeResource(“img/16/thüringen.png”));

The icon appears, when the resourceId does not contain a German umlaut. The icon does also appear, if use a ClassResource instead of a ThemeResource and move the PNG file to the classpath.

I use Vaadin 7.1.15. Is this a bug?

Best regards,
Winfried

You really shouldn’t use non-ASCII letters for filenames or other identifiers.

It could work, if you have the correct character encoding in your IDE for the source files, filesystem, and the server accesses the file with the correct encoding or handles conversion. For URLs and HTML, UTF-8 is assumed at least in Vaadin, but many filesystems and editors use something different. Linuxes like Ubuntu nowadays usually use UTF-8 for file names, but might not. OSX uses UTF-16 Unicode, but not certain if it’s always properly converted to UTF-8 and not something else, NTFS also stores file names in UTF-16, but FAT uses the Windows-1251, etc.

I’m not exactly sure why it works for class resources, but not theme resources. Class resources are served very differently, by the servlet as dynamic resources, while theme resources are served directly by the server (and could even be served by a front-end server). Class resources too have a filename, but it may be used differently. I’d have to check how it goes, but that may not be relevant for your problem with theme resources.

Thanks.

Using non-ASCII letters is OK for me, even if it looks like a (minor) bug for me.