rejetto forum

RAWR-Player and special characters

ladiko · 29 · 13979

0 Members and 1 Guest are viewing this topic.

Offline ladiko

  • Occasional poster
  • *
    • Posts: 75
    • View Profile
Hello :-)

It seems like the RAWR-Player doesnt support special characters, for example ä ö ü ß é è, in folder or file names. is this known? is there an update planed?

thx in advance :-)



Offline day

  • Occasional poster
  • *
    • Posts: 65
    • View Profile
edit: deleted to avoid misleading
« Last Edit: December 01, 2007, 03:41:59 PM by dayletter »


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Does that actually work dayletter? If it does I may look into using it.


Offline day

  • Occasional poster
  • *
    • Posts: 65
    • View Profile
edit: deleted to avoid misleading
« Last Edit: December 01, 2007, 03:49:55 PM by dayletter »


Offline parade

  • Tireless poster
  • ****
    • Posts: 138
    • View Profile
I think I found the solution...

try to change all "escape(" to "encodeURI("
and "unescape(" to "decodeURI("
I would like to try this.
Where do I have to change? In The RAWR-PreviewBox.js?


Offline ladiko

  • Occasional poster
  • *
    • Posts: 75
    • View Profile
hmm there was a homepage for mobile devices where i needed encodeURIComponent(unescape(MyQuery)) to get it working. i try it later :-)

thank you for the information where to search. i post my results here.

Edit:
yeeeaaah!!! that's it!!!
go to RAWR-PreviewBox.js and change in line 87:
Code: [Select]
+escape(content)+to
Code: [Select]
+encodeURI(unescape(content))+
works with most european special characters in file and folder name. -->

for asian special characters i only get a question mark "?" in file listing so i maybe i need to install something to support it or it is a fault of HFS - should be tested by someone else :-)
« Last Edit: December 01, 2007, 01:29:12 PM by ladiko »


Offline day

  • Occasional poster
  • *
    • Posts: 65
    • View Profile
ok..after some searching..

escape(charString)
Quote
The escape method returns a string value (in Unicode format) that contains the contents of charstring. All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the character. For example, a space is returned as "%20."

Characters with a value greater than 255 are stored using the %uxxxx format.

Note   The escape method should not be used to encode Uniform Resource Identifiers (URI). Use encodeURI and encodeURIComponent methods instead.

encodeURI(URIString)
Quote
The encodeURI method returns an encoded URI. If you pass the result to decodeURI, the original string is returned. The encodeURI method does not encode the following characters: ":", "/", ";", and "?". Use encodeURIComponent to encode these characters.

encodeURIComponent(encodedURIString)
Quote
The encodeURIComponent method returns an encoded URI. If you pass the result to decodeURIComponent, the original string is returned. Because the encodeURIComponent method encodes all characters, be careful if the string represents a path such as /folder1/folder2/default.html. The slash characters will be encoded and will not be valid if sent as a request to a web server. Use the encodeURI method if the string contains more than a single URI component.

----------------------------------------------------------------------------

I have done some experiments:

let say you want to convert the filename "測試" into "%E6%B8%AC%E8%A9%A6", which can then be used by the RAWR-player

content = %link-url%

case 1:

if the option "Encode non-ASCII characters" is switched on
%link-url% == "%E6%B8%AC%E8%A9%A6"

if you escape(content), it becomes "%25E6%25B8%25AC%25E8%25A9%25A6".
if you encodeURI(content),  it also becomes "%25E6%25B8%25AC%25E8%25A9%25A6".

in both case, "%" is converted into "%25",
for the mp3 player, it still works.
but for the divx player, seems like it doesn't?

case 2:

if the option "Encode non-ASCII characters" is swtiched off
%link-url% == "測試"

if you escape(content), it becomes "%u6E2C%u8A66", so it doesn't work.
but if you encodeURI(content),  it becomes "%E6%B8%AC%E8%A9%A6", so it works.

Since %link-name% always == "測試" no matter the option is on or off,
so, in my opinion, using %link-name% & encodeURI is better than using %link-url% & escape for Chinese characters.
« Last Edit: December 01, 2007, 02:22:19 PM by dayletter »


Offline ladiko

  • Occasional poster
  • *
    • Posts: 75
    • View Profile

Offline day

  • Occasional poster
  • *
    • Posts: 65
    • View Profile
and what about encodeURI(unescape(content)) ?

i GUESS in your case encodeURI() is the same as escape() since the values of characters of your language are not greater 255, and you have the option switched on.

Therefore content = %item-link% is in encoded form, and so
encodeURI(unescape(content)) == content

maybe you could try

Quote
changing +encodeURI(unescape(content))+ to +content+

OR

Quote
switching off the option,
changing +encodeURI(unescape(content))+ back to +escape(content)+

to prove my theory.
« Last Edit: December 01, 2007, 02:24:31 PM by dayletter »


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Will have a play and include this fix in the next builds.

Sometimes ignorance is bliss. :) i wasn't even attempting to fix this :P thats why i like the forum so much. Thanks for your post :D

Before i implement... can i get someone to test this in IE6/7 Firefox and Opera. Nothing goes into the template until it works in all of those.


Offline day

  • Occasional poster
  • *
    • Posts: 65
    • View Profile
IE7 & Firefox works for me.

BTW, I think the effect of the option "Encode non-ASCII characters" is large and so must be considered.
I suggest that every template should be designed with that option swtiching on.
This is because with this you can use %encoded-folder% & %item-url% for encoded form,
and %folder% (%item-folder%) & %item-name% for original form.

« Last Edit: December 02, 2007, 02:06:19 PM by dayletter »


Offline ladiko

  • Occasional poster
  • *
    • Posts: 75
    • View Profile
tested with firefox2 and ie7

+escape(content)+ & Encode non-ASCII-characters on

Firefox:divx-web-player ok, rawr-player not working
IE: rawr ok, divx not working

+escape(content)+ & Encode non-ASCII-characters off
Firefox:divx-web-player ok, rawr-player not working
IE: rawr ok, divx not working

############################

+content+ & Encode non-ASCII-characters on
Firefox: ok
IE rawr ok, divx not working

+content+ & Encode non-ASCII-characters off
Firefox: ok
IE: ok

############################

+encodeURI(unescape(content))+ & Encode non-ASCII-characters on
Firefox: ok
IE: rawr ok, divx not working

+encodeURI(unescape(content))+& Encode non-ASCII-characters off
Firefox: ok
IE: ok


Offline day

  • Occasional poster
  • *
    • Posts: 65
    • View Profile
+content+ & Encode non-ASCII-characters off
Firefox: ok
IE: ok

hmm...so your language does not even need to encode to have it working...
However, it is not that simple in my case...
I'm going make a quick fix and upload it here,
to see if it works for you or not..

edit:alright..uploaded..please try~
remember to switch on "Encode non-ASCII characters"
« Last Edit: December 01, 2007, 05:36:59 PM by dayletter »


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Thankyou for your testings. I will add this fix for next builds.