Patrick: 
>  Publishing photos on Internet, I got problems with filename with
>  accent. For example, a photo named "Ebouriff�e.jpg" displays well under
>  Windows, but give me an "HTTP error 404" under Linux.

Getting universally-acceptable files names takes a little care. REBOL.org, 
for example accepts script contributions whose names are (I think this is the 
full set of rules):

-- made up only of lowercase unaccented letters, hyphens, digits, and periods 
(".")
-- First and last cannot be hyphens or periods
-- First cannot be a digit
-- Maximum of one period

Those rules are a little restricted (no spaces or "$" or "#" etc), but they 
should stand the test of time.....Though we probably need to think about a 
maximum file name length.


Here's a function to convert accented letters. You might want to edit 
'replacements to replace accents with digraphs or other multi-letter combinations.

=====

deaccent: func [file-name [file!]
            /local accents replacements
            ]
[
      accents: ["�" "�" "�" "�" "�" "�" "�"]
 replacements: ["a" "e" "e" "i" "o" "u" "c"]
 
 lowercase file-name
 foreach accent accents
    [replace/all file-name accent pick replacements index? find accents 
accent]
] ;; func
 
print ["before " f]
f: %Ebouriff�e-�������-�������.jpg 
deaccent f 
print ["after " f]

=====

Sunanda.

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to