Special characters in file names and directories

I'm building a site that lets users create directories to
which they give the name they want.
Using PHP, is there one universal solution to avoid any
special characters in directories, yet will
display the directory/file names in html the way the user
intended?
example of a possible name:
"ça alors: it's a déjà-vu"
How can I encode this so it's valid as a directory name, yet
can be displayed as intended when the
name is output to the page. urlencode() does not do the job,
neither does htmlentities()...
seb ( [email protected])
http://webtrans1.com | high-end web
design
Downloads: Slide Show, Directory Browser, Mailing List

(_seb_) wrote:
> Gary White wrote:
>> On Sun, 19 Nov 2006 19:15:04 +0100, "(_seb_)"
<[email protected]> wrote:
>>
>>> "ça alors: it's a déjà-vu"
>>>
>>> How can I encode this so it's valid as a
directory name, yet can be
>>> displayed as intended when the name is output to
the page.
>>> urlencode() does not do the job, neither does
htmlentities()...
>>
>>
>> What's wrong with:
>>
>> $l="ça alors: it's a déjà-vu";
>> print urlencode($l)."<br>\n";
>> print htmlspecialchars($l);
>>
>> Gary
>
>
> I know that, but what is the name of the directory? It
has to be a real
> directory name, not a string stored somewhere.
>
> What's a valid encoding for a directory named "ça
alors: it's a
> déjà-vu"? I can call a folder like this on my
Mac, but it won't work on
> any server...
>
>
>
PS: basically it's not a url encoding issue.
I can url encode "ça alors: it's a déjà-vu",
and pass it in a url query string. But my issue is not
with an url query string, it's with an actual URL, that is,
the actual name of the directory. It
can't be "ça alors: it's a déjà-vu". But I
want to allow the user to name their directory like that
if they want. So I need a way to encode this into characters
that can be used for an actual
directory on the server.
seb ( [email protected])
http://webtrans1.com | high-end web
design
Downloads: Slide Show, Directory Browser, Mailing List

Similar Messages

  • Mail.app hang if mail attachment have special characters in file name

    Hello,
    I have upgraded to 10.5.1 from last version of Tiger.
    After upgrade is not possible send message with attachment which have a czech special characters in file name (like á, í, é, ý, ú, ů, ě, š, č, ř, ž) with Mail.app. If I try it, CPU is overloaded and I must kill Mail.app process.
    The same problem have my friends who are running a clear installation of Leopard 10.5.1.
    Thanks for correction.

    I have the same problem with Hungarian chars. I tried out Tomas suggestion and it really worked. It is so dissaponting to have this kind of bug in a system like this. They never tested against this situation.
    I hope somebody at apple read this discussion and somehow this will be fixed in the near future.

  • Image Capture and special characters in file names.

    Hung up image capture yesterday: We tried to enter a date in the file name of the document we were scanning. It proceeded normally, but then did not save the file and image capture would not scan again until OS restarted.
    Problem repeated until we discovered a slash in the file name box. Changed the file name and everything works now.
    Software should either prevent user from entering special characters in the file name box, or properly handle the error and not hang up the application.

    Hi,
    Would mind providing a screenshot about how your Content Query Web Part rendering in your environment?
    In my environment, it displays the filename which contains periods:
    I would suggest you create a new page and insert a Content Query Web Part to perform the test again.
    Feel free to reply with the test result or if there any progress.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Content Query Web Part and special characters in file names

    Hi All,
    Is there an out-of-box way to display periods in a file name if I am displaying a document library files? I do not want to end up doing a custom item style if possible.
    For example, file name is 8.5x11Letterhead.docx, 8.5x11Resume.pdf etc.  I do not want to display the file names as 85x11Letterhead.docx.
    Thanks

    Hi,
    Would mind providing a screenshot about how your Content Query Web Part rendering in your environment?
    In my environment, it displays the filename which contains periods:
    I would suggest you create a new page and insert a Content Query Web Part to perform the test again.
    Feel free to reply with the test result or if there any progress.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Special characters in file name of attachment...

    Hello,
    I attached a file in SC which had # in the file name. I was not able to open the attachment... Is there any restrictions on using the special characters in attachment file name?
    Regards
    Amit

    Hi. Yes, we had the exact same thing. If the file name is not A to Z or 0 to 9 it can not be opened.
    I think we asked SAP and there was no solution for our system.
    I think it depends on your file system and things like that though.
    Regards,
    Dave.

  • Special Characters in File Names

    Hello!
    I'm experiencing some difficulties with the file names
    RoboHelp is producing. I have imported my Frame files by reference
    and am generating Web Help.
    RoboHelp apparently does not like hyphens/em dashes in file
    names - when I generate help, I get files names with unusual
    characters in the file names (where the hyphen/em is supposed to
    go).
    For example:
    - A Frame heading 1 is this: Agent HTTP tunneling
    —proxy server
    - The RoboHelp topic generated is this: agent_http_tunneling
    %E2%80%94proxy_server.htm
    These characters are breaking my nightly builds. Is there a
    way to configure how RoboHelp deals with em dashes? If so, where
    would I do that?
    Thanks very much for the help!
    diane

    Maybe
    this
    post will help.

  • Rename Files while uploading, having special characters in File Name.

    Hello Forum,
    In our SharePoint environment, we are having many document library. Our users regularly uploads files to the documents library. As SharePoint doesn't allow to use "&"  character in file name, it'll throw an exception regarding the file
    name.
    Now what I needed is :
    Is there any way to remove "&" character while uploading files? Can we replace "&" with any other character while uploading files.
    If is there any paid solution available, leave comment.
    Thanks in Advance.

    You have to change the folder/file names before hand then upload them to Sharepoint.
    here is the script which will scan the files/folder and find the special charaters and fix for you.
    http://get-spscripts.com/2011/11/use-powershell-to-check-for-illegal.html
    Courtesy :Waqas
    Sarwar(MCSE 2013)
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Special characters in joins name and Identifiers

    I am working on a business area which was created a time ago. Joins name contain special characters. Regarding Oracle, these are not going to be accepted in the new versions.
    How can I fix this problem, knowing any change in joins name will affect the workbooks.

    You can - and should - double check this, but I believe changing the name only of the join will not cause a problem per se.
    It's when you change the name AND the identifier in one fell swoop that a problem will occur.
    That's because when Disco opens up a workbook, it will look for the name OR identifier (if, for example, the name was changed).
    So, in theory, you could change the name of a join, folder, etc. and then open all your Discoverer workbooks and then save them again. Now they will have knowledge of the new name.
    Then if you wanted - and ALL workbooks were already run and re-saved - you could change the identifier and do the whole process over again.
    So, to summarize, I believe that just changing the actual join name ONLY will not cause any problem.
    Russ

  • Recover initials files name and directories name

    Ladies & Gentlemen,
    I am newby with iTunes, and I look for some answers.
    Before I'd installed iTunes and I'd connected my ipod, I have all my music organized by myself.
    After that all my files were renamed, directories have changed etc.
    It's crazy, I don't want iTunes make that!
    Now how can I recover all my entries like before?
    Please answer me.
    Thnaks in advance
    moscaluc
    AMD Barton 3000+   Windows 2000   Linux Fedora 3 + Unix Solaris X

    The U key toggles the metadata on and off in the Browser. Also see *View->Metadata Display* .
    You might also want to take a look at [Working with Metadata|http://discussions.apple.com/post!reply.jspa?messageID=13291231] in the User manual. There's lots of good things you can do with it.

  • French Characters in File Names

    Hello,
    Despite my instance not use French and/or other special
    characters in files names, we have inherited a project (approx 2500
    topics) with French characters in the file name. When we generated
    the project and post it on an Apache server, the topics do not
    display as the server replaces the characters with symbols.
    RX5, during the generation process, replaced the French
    characters with underscores, RX 7.0.1 keeps the characters within
    the file name. In RX 7.0.1 is it possible to replace the characters
    with underscores during the generation process?
    Regards,

    If this is the other thread, then you did get a response, several in fact. It may not have been the answer you wanted but that's another matter.
    http://forums.adobe.com/message/129875#129875
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Special Characters in Report Name or Report Description(URGENT)

    Hi All,
    I am using Hyperion Financial Reporting System 9 tool. Could anyone tell me what problem we face if we use special characters in report name and report description?
    Waiting for quick response.
    Regards,
    SN

    when using "&" in report and folder titles we had issues with report books not being able to run and also the report name would be incorrectly described.
    try to avoid if possible, there is a lower risk if using on an all windows enviroment (clients and servers) but if you have *nix OS it does introduce complexity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Prevent using special characters in file and folder names?

    I've recently begun adding windows clients to my network. In doing so, I've found that on my file shares from OS X server, the windows clients are unable to see files and folders which have names containing special characters such as / ? < > \ : * | ”
    Unfortunately my accounting department has been creating files with these characters in their names for several years. I would like to find if there is a way to prevent them from using a defined set of characters in the file and folder names to prevent them from "accidentally" doing so in the future.
    I've found that by turning off streams support on SMB in OS X server, that my windows clients can at least see that a file or folder should exist, albeit with a corrupted file name. Removing the special characters from these names allows the proper name to become visible and the file accessible.
    Any info would be greatly appreciated.

    (_seb_) wrote:
    > Gary White wrote:
    >> On Sun, 19 Nov 2006 19:15:04 +0100, "(_seb_)"
    <[email protected]> wrote:
    >>
    >>> "ça alors: it's a déjà-vu"
    >>>
    >>> How can I encode this so it's valid as a
    directory name, yet can be
    >>> displayed as intended when the name is output to
    the page.
    >>> urlencode() does not do the job, neither does
    htmlentities()...
    >>
    >>
    >> What's wrong with:
    >>
    >> $l="ça alors: it's a déjà-vu";
    >> print urlencode($l)."<br>\n";
    >> print htmlspecialchars($l);
    >>
    >> Gary
    >
    >
    > I know that, but what is the name of the directory? It
    has to be a real
    > directory name, not a string stored somewhere.
    >
    > What's a valid encoding for a directory named "ça
    alors: it's a
    > déjà-vu"? I can call a folder like this on my
    Mac, but it won't work on
    > any server...
    >
    >
    >
    PS: basically it's not a url encoding issue.
    I can url encode "ça alors: it's a déjà-vu",
    and pass it in a url query string. But my issue is not
    with an url query string, it's with an actual URL, that is,
    the actual name of the directory. It
    can't be "ça alors: it's a déjà-vu". But I
    want to allow the user to name their directory like that
    if they want. So I need a way to encode this into characters
    that can be used for an actual
    directory on the server.
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • File Name and Path special field

    Post Author: puser01
    CA Forum: .NET
    I have a report created in CR 9 with the File Name and Path special field on the report displayed correctly. when i try to run it on CR XI environment i get this:
    C:\WINDOWS\TEMP\{4D86438D-54F5-4EEF-A0AB-05D5EB2BFF35}.rpt
    How can i correct this?

    Our installer names don't make it easy for the new user, or the seasoned veteran for that matter. Although both those installers have 2008 in the name, they are for entirely different products.
    CRRedist2008_x86.msi
    This MSI installer is used to install the runtime for Crystal Reports Basic for Visual Studio 2008 - version 10.5.
    cr2008fp35.exe
    This installer package is used to install the CR .NET runtime for Crystal Reports 2008 - version 12.3.
    Since you've updated your development system to Crystal Reports 2008 you'll only want to use the runtimes listed on this reference page - http://www.sdn.sap.com/irj/sdn/crystal-xcelsius-support?rid=/webcontent/uuid/10e38d93-7f07-2d10-beae-e739182f8ada. [original link is broken]
    I suggest either of these
    SP 3
    https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
    FixPack 3.5
    https://smpdl.sap-ag.de/~sapidp/012002523100006341772011E/cr2008fp35_redist.zip

  • Sqlldr does not understand unicode characters in file names

    Hello,
    I am trying to call sqlldr from a .net application on Windows to bulk load some data. The parameter, control, data, log files used by sqlldr, are all located in the C:\Configuración directory (note the unicode character in the directory name).
    Here is my parfile:
    control='C:\Configuración\SystemResource.ctl'
    direct=true
    errors=0
    log='C:\Configuración\SystemResource.log'
    userid=scott/tiger@orasrv
    When I make a call as
    sqlldr -parfile='C:\Configuración\SystemResource.par'I am getting
    SQL*Loader-100: Syntax error on command-line
    If I run it as
    sqlldr -parfile='C:\Config~1\SystemResource.par'I am getting
    SQL*Loader-522: lfiopn failed for file (C:\Configuraci├│n\SystemResource.log)
    If I remove the log= parameter from the parameter file, I am getting
    SQL*Loader-500: Unable to open file (C:\Configuraci├│n\SystemResource.ctl)
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: The system cannot find the file specified.
    Can anyone suggest a way to handle unicode/extended ASCII characters in file names?
    Thanks,
    Alex.

    Werner, thank you for replying to my post.
    In my real application, I actually store the files in %TEMP%, which on Spanish and Portuguese Windows has "special" characters (e.g. '...\Administrador\Configuración local\Temp\'). In addition, you can have a user with the "special" characters in the name which will become part of %TEMP%.
    Another problem is that 8.3 name creation may be disabled on NTFS partitions.
    Problem #3 is that the short file names that have "special" characters are not converted correctly by GetShortPathName windows API, e.g. "Configuración" will be converted to "Config~1", but for "C:\ración.txt" the api will return the same "C:\ración.txt", even though dir /x displays "RACIN~1.TXT". Since I am creating the parameter and control files programmatically from a .net application, I have to PInvoke GetShortPathName.
    Any other ideas?
    Thanks,
    Alex.

  • Printing FILE NAME and DATE PRINTED?

    when i was on a mac i used to be able to have a default in the printer dialog so that every page printed showed the file name and the data printed. i would like to do this in the mac but i am guessing that this has to be done in either the specialized software dialog box or perhaps in a mac dialog box?
    in any event, can anyone help me figure out where i might find a place to do this? i haveadobe acrobat but i wold also like to do it in something like Preview as well.
    TIA

    hotwheels 22 wrote:
    if i have documents coming that i print for a project and these are quite naturally coming from different software it i have no way now of being able to FIND this file in my computer when i am looking at it.
    Consider using Find from the File menu or Spotlight to search for the document. In one of your previous posts, you stated that you name documents with a date and name. Then perhaps search for the name. Also, with your method of naming documents, if the document is a letter, wouldn't the date on the letter and the person to whom the letter is addressed to give clues to the filename and thus finding it on your computer?
    this is a major organizational issue over here and customizing a template for all my various software should be unnecessary IMHO.
    I do not know how many documents you deal with but I do know that there a many organizations that deal with billions of documents. In addition, if you share documents with others or others with you, there is not a filenaming method that works for everyone. People adapt to each other. A date in a filename could have several forms such as month-date-year or year-month-date, two digits or four digits for year and so on and so forth.
    Are you saying it IS necessary to have this dual file type that has a Pages document which then prints a PDF?
    No. Please re-read  what I wrote and the Pages Help Center articles.
    also, is there in fact a way to save a PDF back out as a Pages document?
    Yes, re-read what I wrote (that which you quoted).
    "Acrobat has the capability to save a PDF in other formats such as Microsoft Word, which can be opened in Pages. That said IMO, a separate Pages document for each "custom" letter/report would not be necessary."
    alternatively i guess i could create a Pages TEMPLATE - that has a DATE in the header that automatically updates .../but/ i am realizing that this has the unfortunate consequence of having the DATE updated if i open the Pages document again
    But that is what you stated you wanted because
    ...and try to remember to SAVE AS this document with another name with the original FILE NAME but a NEW DATE. this does not always work and sometimes i write over the original accidentally.
    anyway, maybe the answer here is to create a Template for any new document type and simply use this template any time i need to create a PDF and then not save or delete the original Pages document but this seems a bit hairy and dangerous in terms of possibly losing a file if i forget to print to PDF or something.
    You have redundant backups, yes?
    It seems that your understanding of a template is different from what it actually is, its purpose and its use. If you have not already done so, try using one of the included Pages templates to create a document that you would reuse to get a better understanding of how it works and to help determine your workflow. What you wrote in the last post seems to be a lot of what ifs but not hands on experience with the software itself. My response was based on my experience of using many types of software and in particular to your questions, Pages and Acrobat. Perhaps you will find better responses in the Pages forum and for Acrobat there is a forum at the Adobe web site.
    is there a lock file functionality in Pages in Mountain Lion or was this in Lion?!
    Perhaps reviewing the tutorials for Pages or searching with Google would  help answer many of your questions.

Maybe you are looking for