Error in file name encoding on OS X

This little java program fails when creating a new file with the Danish letter "�" (U+00C5) and then trying to find the same file. It cannot find it - the name has been messed up in the encoding/decoding.
The program only fails on OS X 10.4. The charset is MacRoman. If I look for the file in OS X it looks fine.
It runs fine on Windows XP.
Anyone who can explain this?
public class Test
    public static void main(String []args)
        try
            String arr[] = {
                    "\u0026\u0416\u4E2D\u10346"    //http://www.tbray.org/ongoing/When/200x/2003/04/26/UTF
                    ,"\u00C5" //AA
                    ,"\u00d8" //OE
                    ,"\u00E6" //AE
            for (int i = 0; i<arr.length; i++)
                String filename = arr;
String folder = "/Users/.../shared/1/";
java.io.File f = new java.io.File(folder + filename);
f.createNewFile();
f = new java.io.File(folder);
boolean found = false;
String[] files = f.list();
for (int j=0; j<files.length; j++)
if (files[j].equals(filename))
found = true;
System.out.println(arr[i] + " : " + found);
catch (Exception ex)
System.out.println(""+ex);

Here is a even more clear example that something is wrong. CompareTo returns != 0 for all files in a folder, even when compared to the file object, from which a file was just created.
Again this works fine with Windows XP.
public class Test
     public static void main(String []args)
          try
               String filename = "\u00C5"; //Danish �
               String folderPath = "/Users/.../shared/";
               //Create file.
               java.io.File file = new java.io.File(folderPath + filename);
               file.createNewFile();
               //Loop folder          
               java.io.File folder = new java.io.File(folderPath);
               java.io.File[] files = folder.listFiles();
               for (int j=0; j<files.length; j++)
                    java.io.File folderFile = files[j];
                    System.out.println(folderFile + " compareTo: " + file.compareTo(folderFile));
          catch (Exception ex)
               System.out.println(""+ex);
}Message was edited by:
stigcAtSun2

Similar Messages

  • Getting error logical file name not maintained adequtely

    Hi,
    when i execute a z report and press the download botton getting error logical file name not maintained adequtely,see long text.
    Below code i wriien. Please somebody help..
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'DOWNL'.
    Determine and construct OS specific file name                        *
            PERFORM get_file_name_for_os.
    in the  above perform , i wriien
    FORM build_file_name USING pf_os
                               pf_with_file_extension
                               pf_param_1
                               pf_format
                               pf_fname.
      DATA: lf_para1(20) TYPE c.
    pf_param_1 hold the materialnr with leading zeros not prefered in    *
    download file name                                                   *
      WRITE pf_param_1 TO lf_para1.
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
      CLIENT                        = SY-MANDT
          logical_filename              = 'Z_MATERIAL_BOM_FILE'
          operating_system              = pf_os
          parameter_1                   = lf_para1
      PARAMETER_2                   = ' '
      PARAMETER_3                   = ' '
      USE_PRESENTATION_SERVER       = ' '
          with_file_extension           = pf_with_file_extension
      USE_BUFFER                    = ' '
        IMPORTING
      EMERGENCY_FLAG                =
        file_format                   = pf_format
        file_name                     = pf_fname
    EXCEPTIONS
       file_not_found                = 1
       OTHERS                        = 2
    Error handling.
      CASE sy-subrc.
        WHEN '1'.
          MESSAGE e014(ba) WITH 'Z_MATERIAL_BOM_FILE'.                     "error message i am getting      LEAVE.
        WHEN '2'.
          MESSAGE e213(ky) WITH 'Z_MATERIAL_BOM_FILE'.
          LEAVE.
      ENDCASE.

    Hi.
    In file txn,
    click on "Logical File Name Definition, Cross-Client" from the left.
    Then click position and check for your logical file name.
    If you dont get it, it means you need to create it. You can click on New Entries to create.
    Thanks
    Mani

  • File Name Encoding resets to Roman from Cyrillic when importing into iTunes

    I have added a large number of Russian songs to my library. Many of the file names were not imported using the correct file name encoding. I downloaded the file name encoding repair app and fixed all the file names in my iTunes library, but whenever I add the songs into iTunes, the names are reset to Roman encoding from Cyrillic. Is there any way to set and lock the encoding so iTunes doesn't reset it?

    Fixing the filenames probably doesn't do what you need. iTunes uses the ID3 tags. See this note for info on fixing those:
    http://homepage.mac.com/thgewecke/mlingos9.html#itunes

  • Error: "The file name needs to be specified for all documents."

    Hello
    I am trying to make sendDocument api call with the following xml:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://dto.api.echosign" xmlns:ns2="http://api.echosign" xmlns:ns3="http://dto14.api.echosign" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header/>
    <ns0:Body>
    <ns2:sendDocument>
    <ns2:apiKey>content filtered</ns2:apiKey>
    <ns2:senderInfo xsi:nil="true"/>
    <ns2:documentCreationInfo>
    <ns1:fileInfos>
    <ns1:file>CONTENT FILTERED</ns1:file>
    <ns1:fileName>test.pdf</ns1:fileName>
    <ns1:mimeType>application/pdf</ns1:mimeType>
    </ns1:fileInfos>
    <ns1:name>Test.pdf</ns1:name>
    <ns1:recipients>
    <ns3:email>[email protected]</ns3:email>
    <ns3:role/>
    </ns1:recipients>
    <ns1:reminderFrequency>DAILY_UNTIL_SIGNED</ns1:reminderFrequency>
    <ns1:signatureFlow>SENDER_SIGNS_ONLY</ns1:signatureFlow>
    <ns1:signatureType>ESIGN</ns1:signatureType>
    </ns2:documentCreationInfo>
    </ns2:sendDocument>
    </ns0:Body>
    </SOAP-ENV:Envelope>
    Which gives me an error: 'The file name needs to be specified for all documents'. Why does it happen? I specified the file name.

    I think you need to fix the recipient section, it looks incomplete. Use a tool like SoapUi to build and execute requests to the service.
    and/or the sample request in the documentation:https://secure.echosign.com/static/apiv19/sampleXml/sendDocument-request.xml

  • [SOLVED] File name encoding issue

    Hi all,
    I have a large series of files with accented characters, they were all displayed nicely, but at some point, when I copied them to another computer, the characters were replaced by codes, for instance: "ó" --> "ó".
    +Renaming ie. "Pasó" (bad encoding of "Pasó") --> Pasó, while writing it, it shows the correct character, but when pressing enter the name remains ("Pasó")
    +If I rename the file to something else and then to the correct name, it will accept it: Pasó --> Pas --> Pasó will display correctly.
    I don't know if it's a system wide encoding issue because new files are displayed correctly, but I would like to know if I have to change file names manually to make them right.
    PS. When copying bad encoded files to another FS (like a USB drive), nautilus and bash refuse to copy them.
    Last edited by Wasser (2012-09-17 21:10:52)

    My fstab:
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    tmpfs /tmp tmpfs nodev,nosuid 0 0
    # /dev/sda2 LABEL=ROOT
    UUID=d2243d9c-b8e7-442a-8446-5a43a4d9221b / ext4 rw,relatime,data=ordered 0 1
    # /dev/sda5 LABEL=HOME
    UUID=e67f5cfa-3ec3-4c06-9c2c-62c4cc188ffe /home ext4 rw,relatime,data=ordered 0 2
    # /dev/sda3 LABEL=VAR
    UUID=caac4924-2a13-4c97-9926-668ac0595ba3 /var reiserfs rw,relatime 0 2
    # /dev/sda1 LABEL=UEFI
    UUID=1E70-6485 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
    # /dev/sda4
    UUID=14993c2e-4bc4-42e4-b2e5-9dbc286abb4c none swap defaults 0 0
    Files in question are in /dev/sda5 (HOME)
    Last edited by Wasser (2012-09-16 08:37:52)

  • Error dynamic File Name in Receiver File Adapter

    Hi all,
    Dynamic file name for Receiver file Adapter Problem
    my multi mapping look like this in design mode
    messages
         message1
              SD01_E
                   FileName
                   row
         message2
              SD02_E
                   FileName
                   row
    by processing the xml look like this:
    <ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    or
    <ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    in file receivere adapter  i have try this but it dos not work
    payload:SD01_E,1,FileName,1
    Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
    is there any way to have access to Filename  in different root elements??
    regards
    Ralf

    Hi Ralf,
    i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
    Regards,
    Udo

  • Plugin Register Error - Assembly file name is in invalid format. Only file name is allowed.

    Hi,
    when I add a step in a plugin registered in disk using the 2013 or 2011 tool for CRM 2013. it got a error as below.
    Assembly file name is in invalid format. Only file name is allowed.
    Anyone know this? thank you.
    Detailed log as below
    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Assembly file name (LoyaltyEngine.CRM.Main.Plugin.dll) is in invalid
    format. Only file name is allowed.
    Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <ErrorCode>-2147204719</ErrorCode>
      <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Assembly file name (LoyaltyEngine.CRM.Main.Plugin.dll) is in invalid format. Only file name is allowed.</Message>
      <Timestamp>2014-12-31T05:16:55.9984484Z</Timestamp>
      <InnerFault>
        <ErrorCode>-2147204719</ErrorCode>
        <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
        <Message>Assembly file name (LoyaltyEngine.CRM.Main.Plugin.dll) is in invalid format. Only file name is allowed.</Message>
        <Timestamp>2014-12-31T05:16:55.9994483Z</Timestamp>
        <InnerFault i:nil="true" />
        <TraceText i:nil="true" />
      </InnerFault>
      <TraceText i:nil="true" />
    </OrganizationServiceFault>
    Server stack trace:
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
       at Microsoft.Crm.Tools.PluginRegistration.StepRegistrationViewModel.btnRegister_Click(Object sender, EventArgs e)
    Dynamics CRM Consulting

    Hi,
    Have you checked the below links.
    http://mscrmdeveloper.wordpress.com/2014/09/04/problems-adding-step-to-disc-based-plugin-assembly/
    http://gustafwesterlund.blogspot.com/2014/05/issues-with-new-plugin-registration-tool.html
    Hope this Helps!!!
    Thanks,
    Prasad
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

  • Error in File name or class name not found during Automation operation: 'CreateObj​ect'

    Hello Team,
    When I am trying to execute the below code i am getting the following error. Any help would be greatly appreciated.
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    If Not oFSO.FolderExists(SavePath) Then
    Set f = oFSO.CreateFolder(SavePath)
    Else
    End If
    53 4/11/2014 12:27:22 PM Error:
    Error in <NoName(4).VBS> (Line: 9, Column: 1):
    File name or class name not found during Automation operation: 'CreateObject'
    I have googled through the error and tried to re-register the scrrun.dll using regsvr32 eventhogh it is successfully registered, i am getting the following error. My PC is windows 7 32bit OS.
    any help is greatly appreciated.

    The following script class will write a log file entry. See if it will run for you.
    The script is using a class object that you might not have seen before. A little intro:  The top section is just for testing the class. Normally I just comment this out after the class is working well.  It should run right way. I would save the vbs file in the editor, That way when you are using autoactpath or currentscriptpath variables they will be able resolve the paths.
    Paul
    Attachments:
    LoggingCode_V2.VBS ‏5 KB

  • Error writing file name which contain both English and non-English name

    Hello
    I have this simple vbscript code which suppose to write all file names in some directory to a text file
    Dim FSO
    Dim FileDirectory
    FileDirectory = "C:\temp"
    Dim FileList
    FileList = "list.txt"
    Dim Fname
    Set FSO = CreateObject("Scripting.FileSystemObject")
    set FileDirectory = FSO.GetFolder(FileDirectory)
    Set objFile = FSO.CreateTextFile(FileDirectory & "\" & FileList ,True)
    for each file in FileDirectory.files
    Fname = file.name
    objFile.Write( ChrW(34) & Fname & ChrW(34) & vbCrLf)
    objFile.Write( ChrW(34) & FileDirectory & "\" & Fname & ChrW(34) & vbCrLf)
    Next
    objFile.Close
    Everything goes fine while file names are in English but when some file name is non English or both  English with non English name (right to left languages) an error raised, so how to deal with this writing issue without changing the file name
    thanks in advance

    Thanks
    jrv for replying
    I tested you code but it didn't worked for me (works fine for English file names but doesn't work with right to left language )

  • File name Encoding

    We have a requirement from our customer for some simple content management. Basically they will get a directory on our server to place pdf files. We then read this folder at runtime and dynamically create a JavaScript tree so that users can view and select their required pdf.
    In terms of display we have a simple policy. The display text is the name of the file with underscores replaced by spaces (e.g. My_Document.pdf --> My Document). We require this functionality (at first) in 6 languages (English, French, Spanish, Dutch, German and Italian).
    The problem we have is concerning the file names with "non-english" chars such e grave, e acute etc used in French, German and Dutch. We have copied the pdfs from a windows server to a Unix server. The code works fine on windows but once ported to Unix we get question marks replacing the chars mentioned. Basically what we do is given a root (e.g. /usr/local/documents/fr) we then call listFiles() on the File object.
    Do you think this is something to do with the encoding of the actual file names? Or perhaps to do with a missing language pack on the Solaris machine? Unfortunately I know very little about Unix and we only have one Unix admin guy who has never encountered this problem before.
    Has anybody else encountered this problem, or know how I can correct this?
    Thanks in advance, Laurence.

    This is the output from the locale command whatever
    this means:
    LC_CTYPE="C"This means you are using the default locale (called "C" probably because of the programming language). In the default locale the encoding that Java picks up is 7bit ASCII which doesn't contain characters like e with acute accent. There are a number of things you can do to change this: you can change the locale through environment variables, or change only the encoding that Java picks up.
    Locale is changed by modifying the LANG environment variable. You can list all available locales with the command "locale -a". For instance to change to US English (which uses the iso-8859-1 encoding with &eacute; etc) you would use these commands before running your program (choose one for the shell you use):tcsh% setenv LANG en_US
        or
    bash$ export LANG=en_USYou can change the encoding that Java picks up from the system with "-Dfile.encoding", for example:java -Dfile.encoding=ISO-8859-1 YourClass> Unfortunatley I cannot get a local login to the
    server. It is a production server in a rack and only
    has remote access. My ssh client (Putty) displays the
    characters correctly.
    Then hopefully this time the file names have been transferred ok and you are able to run the program after either of the modificatios above :)
    Yet again they don't display correctly....Yep, and old bug that the admins haven't arsed to fix, kind of sad considering the i18n support Java has...

  • DFS 2012R2 error "The file name is too long" word file.

    Hi,
    i have two server with NFS, windows Server 2008R2 and Windows Server 2012R2. when open file in shared folder with path long, from 2008R2, is good, but when open the same file en 2012R2, show the message explorer.exe "the file name is too long"
    how to resolve the issue?
    Thank.
    Analista IT, Celr

    Hi, Umesh
    The shared foldes is in both Server, 2008 and 2012, is a folder en NFS.
    the result of command
    PS C:\Users\administrador> fsutil.exe 8dot3name strip /s /v D:\
    Scanning registry...
    Registry Data                                                                    
    Registry Key Path
    Total affected registry keys:                   0
    Stripping 8dot3 names...
    8dot3 Name      FileId                Full Path
    Stripping will not be performed on files with names longer than the maximum path length.
    Error:  The system cannot find the path specified.
    For details on the operations performed please see the log:
      "C:\Users\ADMINI~2\AppData\Local\Temp\2\8dot3_removal_log @(GMT 2015-02-20 19-24-46).log"
    Due to an error, the strip command did not complete.
    Total files and directories scanned:        97740
    Total 8dot3 names found:                        0
    Total 8dot3 names stripped:                     0
    For details on the operations performed please see the log:
      "C:\Users\ADMINI~2\AppData\Local\Temp\2\8dot3_removal_log @(GMT 2015-02-20 19-24-46).log"
    Thank
    Diego Builes.
    Analista IT, Celr

  • Help with iTunes ERROR: duplicate file name specified - where/how?

    When starting up iTunes (version 10.6.1) I get an error message:
    Duplicate file name was specified.
    Needless to say, no clue as to what file name it is referring to. Furthermore, there are 5 songs which I can not play, bought from the iTiunes store. Contacted the iTunes store - they "enabled" the download for those 5 songs. When I connect to the iTunes store, login and check for downloads etc. I get the error message:
    Unable to check for available downloads. Duplicate file name was specified.

    The way to fix this is
    1. Go to Computer
    2. Click Operating System Hard-Drive (C:)
    3. Scroll to Program Files (or) Program Files (x86)
    4. Scroll to iTunes, open it
    5. Find iTunes.exe
    6. Right Click and go to Properties
    7. Click Compatibility you will see something that stats
    Privilege level
    Run this program as an administrator.
    8. Click this and Click Apply and then Ok NOW Open iTunes
    This worked on mine let me know if it doesnt!

  • Itunes error message "file name here cannot be copied because an error occured. There is not enough memory available."

    Hello,
    I have an iPad 64gb. Been trying to load files on it with plenty of memory to spare. generally though i cant load more than about 35mb at a time before the message "file name here cannot be copied because an error occured. There is not enough memory available." pops up. I keep needing to close itunes, unplug my ipad, and restart it again. but the issue remeains the same.
    when i open up task manager i notice that memory usage by itunes goes from 95,000K to 1,750,000K in under 30sec which is when i get the error message. any solutions? currently running itunes on Vista.
    Thanks in advance.

    trash stuff form your computers hard drive to free up space.

  • Error message: file name invalid or too long.  How do I fix this when uploading my purchased cd's???

    Error message when importing a commercial CD: "file name invalid or too long".  How do I fix this????

    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    2c: on 10.7 they're at
    /private/var/db/receipts
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store you can find it in your Purchases List.

  • RIDC check in the file name encoding issue

    Hi,
    When I use the RIDC to upload the chinese file name, the native file field become ??.pdf.
    TransferFile tf = new TransferFile(new File("c:/中文.pdf"), "application/pdf");
    dataBinder.addFile("primaryFile", tf);
    Thanks!

    This is rather a Java than RIDC question.
    Check these links, maybe you will find something useful:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4185525
    http://stackoverflow.com/questions/3610013/file-listfiles-mangles-unicode-names-with-jdk-6-unicode-normalization-issues

Maybe you are looking for

  • Custom window not displaying it's custom template

    I have created a custom window class named CrackenWindow, and a custom template in the Generic.xaml resource dictionary. After I create a new window, which inherits CrackenWindow, nothing happens. The visual remains the same and I cannot use CrackenW

  • Connection Pool - unable to establish connection for one or more OC4J inst.

    Hi. I'm using Oracle JDeveloper 10.1.3.1 to develop some app. Database is Oracle XE 10.2.0. Application server is Oracle Aplication Server 10.1.3.1 After create a needed code, I' v tried establish Connection Pool. When I' v tested connection, next er

  • APPS 11.0.3 unreserve funds

    We are currently using Oracle Financials 11.0.3 modules AP, PO, and GL on HP-UX using Oracle 8.0.5 Can anyone tell me how to find some kind of informations relating to PO lines that have their funds decommited or unreserved from the original PO reser

  • User tables documentation

    HI can anyone please share the user table documentation. Thanks

  • Parse Tablename/Table Owner

    I would like to validate a user's input (via a C Shell) for an Oracle Table name. Can anyone assist me with the SQL statement(s) needed to parse the table owner and table name? null