Unicode Asset Filenames on Windows not working #13807

Closed
Sprachprofi opened this Issue Jan 23, 2014 · 9 comments

Comments

Projects
None yet
6 participants

Rails 3.2.14 (as well as 3.2.11 and potentially earlier versions) refuses to precompile or serve assets whose name includes Unicode characters. This is under Windows 7, which is not known to have Unicode issues. Also, the File library is dealing with these files correctly - File.exists? works and so on. The bug does not occur on Linux. I'm guessing somewhere along the lines someone introduced a function that is not platform-agnostic.

Detailed description of bug, experiments and trace:
http://stackoverflow.com/questions/21111435/how-to-use-asset-names-involving-unicode/21306982#21306982

Member

robin850 commented Jan 25, 2014

Hello @Sprachprofi, thanks for reporting! Looking at the StackOverflow thread, it looks like this is fixed in Rails 3.2.16. If it's not the case, could you please try with Rails 4.0.2 (for instance) ? The 3.2.x versions are not under maintenance anymore.

Rails 3.2.16 did not fix it. (The StackOverflow thread had suggested Rails 3.2.15, which didn't work either).

Even though migrating to Rails 4 is not yet an option for my project (Facebook authentication depends on Devise 2.2.3 which depends on Rails 3.2 or earlier), I also tried this with a brand new Rails 4 project and it's the same problem. Trying to call up an asset called "měiguó.mp3" doesn't work, while swapping the name for "bù.mp3" works. The ě character is only available in Unicode.

The Rails 4.0.2 error message is

No route matches [GET] "/m%C4%9Bigu%C3%B3.mp3"

Not sure if it should be URL-encoding at this point; it didn't do that for bù.mp3 . That might be the error.

Member

senny commented Feb 3, 2014

@Sprachprofi Sprachprofi added the stale label May 27, 2014

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

This has not been fixed yet on Rails 4, see message above.

Owner

rafaelfranca commented May 28, 2014

Could you give us an way to reproduce this issue. It can be an example application. Thanks

@rails-bot rails-bot closed this Aug 19, 2014

This issue has been automatically closed because of inactivity.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

As I described already, it does not require any particular setup at all. For example, rename one of your image assets to 中文.jpg , then include it in ANY of your views as <%= image_tag "中文.jpg" %> or even via the HTML <img src="/assets/中文.jpg" /> . Same for audio or other assets.

Any asset including at least one Unicode character in the file name will not get served in Rails 3 or 4 in Windows, under any circumstances and any setup. You can make a blank project in the latest build of Rails and this kind of asset will fail.

Owner

rafaelfranca commented Aug 20, 2014

This issue is very old and it is stale and nobody tried to fix it. I'd recommend you to take a stab and try to work in a patch. I can help with it if you need help. But I can't promise that if we leave it open it will be fixed by itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment