Our app allows users to upload video.
I noticed, as soon as someone uploads a video with "é" in the file name, the video doesn't play.
For example "fooébar.flv". Question is. Should I be saving file names with those characters or should I filter out those chars? Otherwise, should I find a way for 开发者_运维问答my player to play file names with non-ASCII characters?
I am using JWPlayer, to play the media on our site by the way.
EDIT
I followed http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16002/embedding-with-international-characters which seems to work with:
encodeURIComponent(encodeURI("path_to_file"))
As per ops request in the comments:
I would let them save with non-ascii characters, you don't want to make it harder for your users to upload.
We solved it this way:
file_path = <%= "http://localhost/#{CGI.escape( URI.escape( 'File name with extra charaters like & áéű' ) )}" %>
精彩评论