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 é 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...

Similar Messages

  • 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

  • [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)

  • 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

  • Automount by hal+ default file name encoding

    It seems default file name is iso8859-1 now (correct me), why isn't it UTF8? Which makes names of all my windows files becoming messed up.

    Hi,
    you can use a user Exit after assigning the file. The file name is existing as variable in the function so that you can set this value as document description.
    regards
    Thomas

  • 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

  • Encoding failed in "file name" with error: -43

    Hi!
    I've tried everything but still, after about 20 hours of encoding DVD Studio Pro just stoppes, saying "encoding failed in "file name" with error: -43". The movie is in DV PAL format and made in Final Cut Pro version 5. I'm using DVD Studio Pro 4.0. The movie is about 1 hour and 30 minutes long and I'm trying to put it on a double layer DVD. I've tried to shorten it (it was nearly 2 hours before), but that didn't help. I also tried to shorten it even more and put it on a single layer DVD, but still the same message.
    So if somebody has any idea of how I can solve this problem, please let me know as soon as possible!
    Thank you!

    Error -43 means "File not found." If you are compressing from a reference movie, make sure that all referenced movie clips are present on the disk and that permission settings are not preventing DVD Studio Pro from accessing them.
    Error -1309 means "Out of bounds." This means that the source file is pretending to be bigger than it actually is.
    So it sounds like there are issues with your source movie.
    P.S. Compressor has a much better MPEG-2 encoder and I would recommend using that instead.

  • File name character encoding in zipped file

    Hi All,
    I have the following problem: I have received a zipped file which contains a folder and file structure. The file was zipped on Windows XP with Czech language. The problem is that the folder/file names use Czech characters (codepage CP1250). The characters in filenames after unzipping the structure are corrupted.
    Is there any way how to define the codepage during unzipping or, more in general, way how to convert file names in one codepage to UTF-16 used in Mac's file system?
    Thanks for ideas.

    You might give this a try for converting the filenames after unzipping, though I think it is designed for the old Mac CE encoding rather than the Windows version:
    http://support.apple.com/downloads/FileName_Encoding_RepairUtility
    Otherwise the only option may be manually converting the text strings with something like TextWrangler.

  • Encoded file name for attachment

    Hi
    I'm writing a simple email client that connects to an imap server to fetch messages and save attachment files. The server is exchange. This works perfect, but when the mail is sent from lotus notes, the exchange server encodes the filename, even if there is no strange characters!
    This is the code I use to get the file:
    if (!in.hasNewMessages()) {
      return;
    int nrM = in.getMessageCount();
    int newM = in.getNewMessageCount();
    Message[] messages = in.getMessages(nrM - newM + 1, nrM);
    for (int i = 0; i < messages.length; i++) {
      Object content = messages.getContent();
    String subject = messages[i].getSubject();
    if (content instanceof BASE64DecoderStream) {
    saveFile(messages[i]);
    } else if (content instanceof Multipart) {
    Multipart multi = (Multipart)content;
    for (int j = 0; j < multi.getCount(); j++) {
    BodyPart part = multi.getBodyPart(j);
    saveFile(part);
    private void saveFile(Part part) throws Exception {
    String fileName = part.getFileName();
    if (fileName != null) {
    File file = new File(outFolder, fileName);
    FileOutputStream fos = new FileOutputStream(file);
    part.getDataHandler().writeTo(fos);
    fos.close();
    The fileName looks like this: =?ISO8859-1?Q?thefile.jpg?=
    Is there a way to get the correct file name? Actually, it has to cover cases where the filename has strange characters also like this:
    =?ISO8859-1?Q?F=E4lt=F6?=
    What I have tried is this:
    String newName;
    if (fileName.indexOf("=?") != -1) {
      System.out.println(fileName);
      fileName = fileName.substring(fileName.indexOf("=?") + 2, fileName.lastIndexOf("?="));
      System.out.println(fileName);
      StringTokenizer st = new StringTokenizer(fileName, "?");
      String encodingType = st.nextToken();
      System.out.println(ecodingType);
      String type = st.nextToken();
      System.out.println(type);
      String name = st.nextToken();
      System.out.println(name);
      try {
        String newFileName = new String(name.getBytes(), encodingType);
        newName = newFileName;
      } catch (UnsupportedEncodingException uee) {
        newName = name;
    System.out.println(newName);This is whats printed:
    =?ISO8859-1?Q?F=E4lt=F6.jpg?=
    ISO8859-1?Q?F=E4lt=F6.jpg
    ISO8859-1
    Q
    F=E4lt=F6.jpg
    F=E4lt=F6.jpg
    I've never used new String(byte[] bytes, String charset) before, so It might be that I'm using it wrong?
    Well, here's the question:
    Is there a way to get the fileName correct directly through the Java mail api? If not, how can I decode the filename to the correct name?
    Thanks a lot
    Tobias

    The String constructor interprets the given raw bytes using a given charset. The encoding in mime messages is more of an 'escape sequence' which includes the charset name and mime-encoded bytes (i.e. base64 or quoted printable etc.). You can reconstruct the original String by using the MimeUtility.decodeWord() method, which decodes the bytes and internally calls the String constructor with the appropriate charset.
    try something like
    String name = part.getFileName();
    if (name != null && name.startsWith("=?"))
    name = MimeUtility.decodeWord(name);

  • Setting encoding of file *name*?

    I'm getting file with names containing Latin-1 characters. The java.io.File constructors only take strings for the file names, so I can't set which encoding to use for the file names. Is there any way I can open such a file in Java?
    Thanks,
    -Lars

    A clarification: I'm getting the name of the file as a String, i.e. the non-ASCII characters are there in Unicode in the String. Passing that String to File() results in trying to open a file whose name contains UTF-8 characters, but the file on the file system has the equivalent Latin-1 characters.
    -Lars

  • Apache-zip.jar name attachment file bad encoding

    I have following code. which create zip archive, but name attachment files bad encoding.
    name attachment files in encoding UTF-8. letters of Russian alphabet -"&#1080;&#1084;&#1103;.txt". get - "¯à¨ï⨥  à鸞.txt" OS - Ubuntu 9.10 64-b
    package action;
    import org.apache.tools.zip.ZipEntry;
    import org.apache.tools.zip.ZipOutputStream;
    import java.io.*;
    import java.util.Arrays;
    import java.util.List;
    public class CreateArchive {
        private byte[] getByteFromFile(String file) throws IOException {
            InputStream is = new FileInputStream(file);
            long length = file.length();
            if (length > Integer.MAX_VALUE) {
                throw new IOException("Size file bad: "+file);
            byte[] bytes = new byte[(int)length];
            int offset = 0;
            int numRead;
            while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            if (offset < bytes.length) {
                throw new IOException("Could not completely read file "+file);
            is.close();
            return bytes;
        public void createZip(OutputStream outputStream, List<String> files) {
            byte[] buf = new byte[1024];
            try {
                ZipOutputStream out = new ZipOutputStream(outputStream);
                out.setEncoding("UTF-8");
                for (String fileName: files) {
                    ByteArrayInputStream sourceStream = new ByteArrayInputStream(getByteFromFile(fileName));
                    out.putNextEntry(new ZipEntry(fileName));
                    int len;
                    while ((len = sourceStream.read(buf)) != -1) {
                        out.write(buf, 0, len);
                    out.closeEntry();
                out.close();
            } catch (IOException e) {
                System.out.print(e);
        public static void main(String[] args) throws IOException {
            CreateArchive files = new CreateArchive();
            OutputStream outputStream = new FileOutputStream("file.zip");
            files.createZip(outputStream, Arrays.asList("&#1080;&#1084;&#1103;.txt"));
            outputStream.close();
    }Sorry for me bad english
    Edited by: P1tBull on Mar 24, 2010 5:35 AM

    Real task was create general archive is selected users files and transmission he in one stream
    package action;
    import org.apache.tools.zip.ZipEntry;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.*;
    import java.util.Arrays;
    import java.util.List;
    import java.util.zip.ZipOutputStream;
    public class StreamFiles extends HttpServlet {
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            doGet(request, response);
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            OutputStream out = response.getOutputStream();
            try {
                response.setContentType("'application/zip'; charset='UTF-8'");
                response.setContentType("name=AllFile");
                response.setHeader("Content-disposition", "attachment; filename*=utf-8" + "''" + java.net.URLEncoder.encode("AllFile.zip", "UTF-8") + ";");
                if (request.getHeader("user-agent") != null) {
                    if (request.getHeader("user-agent").indexOf("Safari") != -1) {
                        response.setHeader("Content-Disposition", "attachment");
                        response.setContentType("application/octet-stream");
                    } else if (request.getHeader("user-agent").indexOf("MSIE") != -1 || request.getHeader("user-agent").indexOf("Chrome") != -1) {
                        response.setHeader("Content-disposition", "attachment; filename=" + java.net.URLEncoder.encode("AllFile.zip", "UTF-8"));
                List<String> files = Arrays.asList("catalina.bat", "startup.sh", "version.sh", "tomcat-juli.jar");
                createZip(out, files);
            } catch (Exception ex) {
                request.setAttribute("javax.servlet.jsp.jspException", ex);
                RequestDispatcher requestDispatcher = request.getRequestDispatcher("/error.jsp");
                requestDispatcher.forward(request, response);
            } finally {
                out.flush();
                out.close();
        private byte[] getByteFromFile(String file) throws IOException {
            InputStream is = new FileInputStream(file);
            long length = file.length();
            if (length > Integer.MAX_VALUE) {
            byte[] bytes = new byte[(int)length];
            int offset = 0;
            int numRead;
            while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            if (offset < bytes.length) {
                throw new IOException("Could not completely read file "+file);
            is.close();
            return bytes;
        public void createZip(OutputStream outputStream, List<String> files) {
            byte[] buf = new byte[1024];
            try {
                ZipOutputStream out = new ZipOutputStream(outputStream);
                for (String fileName: files) {
                    ByteArrayInputStream sourceStream = new ByteArrayInputStream(getByteFromFile(fileName));
                    out.putNextEntry(new ZipEntry(fileName));
                    int len;
                    while ((len = sourceStream.read(buf)) != -1) {
                        out.write(buf, 0, len);
                    out.closeEntry();
                out.close();
            } catch (IOException e) {
                System.out.print(e);
    }but mistake on real host don't repeated, so thanks for answer
    Edited by: P1tBull on Mar 24, 2010 8:14 AM

  • Strange problem in Dynamic File Name . XI behaving strangely

    My o/p is coming like this
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_PurchaseOrderChange xmlns:ns0="http://E2open.com/xi/IntercompanySCM_6.0/POChange">
    - <recordset>
    - <data>
      <PoHeaderDomainName>broker_domain</PoHeaderDomainName>
      <PoHeaderOrgName>broker_org</PoHeaderOrgName>
      <PoHeaderPoState>$null</PoHeaderPoState>
      <PoHeaderStateChangeDate>$null</PoHeaderStateChangeDate>
      <PoHeaderPoNumber>4500000026</PoHeaderPoNumber>
      <PoHeaderPoCreationDate>$null</PoHeaderPoCreationDate>
      <PoHeaderLastModifiedDate>$null</PoHeaderLastModifiedDate>
      <PoHeaderModelSubType>Discrete_Order</PoHeaderModelSubType>
      <PoHeaderSupplierName>0000352119</PoHeaderSupplierName>
      <PoHeaderSupplierDescription>$null</PoHeaderSupplierDescription>
      <PoHeaderCustomerName>SSP_CUSTOMER</PoHeaderCustomerName>
      <PoHeaderCustomerDescription>$null</PoHeaderCustomerDescription>
      <PoHeaderCustomerMessage>$null</PoHeaderCustomerMessage>
      <PoHeaderSupplierMessage>$null</PoHeaderSupplierMessage>
      <PoHeaderBillToName>$null</PoHeaderBillToName>
      <PoHeaderBillToAddressDescriptor>$null</PoHeaderBillToAddressDescriptor>
      <PoHeaderBillToAddressAddress1>$null</PoHeaderBillToAddressAddress1>
      <PoHeaderBillToAddressAddress2>$null</PoHeaderBillToAddressAddress2>
      <PoHeaderBillToAddressCity>$null</PoHeaderBillToAddressCity>
      <PoHeaderBillToAddressCountry>$null</PoHeaderBillToAddressCountry>
      <PoHeaderBillToAddressCounty>$null</PoHeaderBillToAddressCounty>
      <PoHeaderBillToAddressState>$null</PoHeaderBillToAddressState>
      <PoHeaderBillToAddressZip>$null</PoHeaderBillToAddressZip>
      <PoHeaderBuyerCode>$null</PoHeaderBuyerCode>
      <PoHeaderFreight>$null</PoHeaderFreight>
      <PoHeaderTerms>0001</PoHeaderTerms>
      <PoHeaderOrderPriority>$null</PoHeaderOrderPriority>
      <PoHeaderCommunicationMode>$null</PoHeaderCommunicationMode>
      <PoHeaderAgreementStartDate>$null</PoHeaderAgreementStartDate>
      <PoHeaderAgreementEndDate>$null</PoHeaderAgreementEndDate>
      <UDFPoHeaderRevisionNumber>$null</UDFPoHeaderRevisionNumber>
      <UDFPoHeaderERPPOCreationDate>01Sep2006000000</UDFPoHeaderERPPOCreationDate>
      <UDFPoHeaderheaderUDF1>$null</UDFPoHeaderheaderUDF1>
      <UDFPoHeaderheaderUDF2>$null</UDFPoHeaderheaderUDF2>
      <UDFPoHeaderheaderUDF3>$null</UDFPoHeaderheaderUDF3>
      <UDFPoHeaderheaderUDF4>$null</UDFPoHeaderheaderUDF4>
      <UDFPoHeaderheaderUDF5>$null</UDFPoHeaderheaderUDF5>
      <PoLineItemPoLineItemId>00020</PoLineItemPoLineItemId>
      <PoLineItemCustomerItemName>E107434516</PoLineItemCustomerItemName>
      <PoLineItemCustomerItemDesc>L1357 TOROID INDUCTOR</PoLineItemCustomerItemDesc>
      <PoLineItemCustomerDomainName>SSP_CUSTOMER_domain</PoLineItemCustomerDomainName>
      <PoLineItemSupplierItemName>E107434516</PoLineItemSupplierItemName>
      <PoLineItemSupplierItemDesc>L1357 TOROID INDUCTOR</PoLineItemSupplierItemDesc>
      <PoLineItemSupplierDomainName>0000352119_domain</PoLineItemSupplierDomainName>
      <PoLineItemUnitPrice>720</PoLineItemUnitPrice>
      <PoLineItemBasisOfUnitPrice>$null</PoLineItemBasisOfUnitPrice>
      <PoLineItemCurrency>EUR</PoLineItemCurrency>
      <PoLineItemUnitOfMeasure>TNE</PoLineItemUnitOfMeasure>
      <PoLineItemLineItemState>$null</PoLineItemLineItemState>
      <PoLineItemStateChangeDate>$null</PoLineItemStateChangeDate>
      <PoLineItemLastModifiedDate>$null</PoLineItemLastModifiedDate>
      <UDFPoLineSupplierItemName>E107434516</UDFPoLineSupplierItemName>
      <UDFPoLinelineUDF1>$null</UDFPoLinelineUDF1>
      <UDFPoLinelineUDF2>$null</UDFPoLinelineUDF2>
      <UDFPoLinelineUDF3>$null</UDFPoLinelineUDF3>
      <UDFPoLinelineUDF4>$null</UDFPoLinelineUDF4>
      <UDFPoLinelineUDF5>$null</UDFPoLinelineUDF5>
      <PoScheduleId>1</PoScheduleId>
      <PoScheduleLastAction>Insert_Or_Modify</PoScheduleLastAction>
      <PoScheduleScheduleState>$null</PoScheduleScheduleState>
      <PoScheduleStateChangeDate>$null</PoScheduleStateChangeDate>
      <PoScheduleRequestQuantity>9.000</PoScheduleRequestQuantity>
      <PoScheduleRequestDate>16Sep2006000000</PoScheduleRequestDate>
      <PoScheduleRequestShipmentDate>16Sep2006000000</PoScheduleRequestShipmentDate>
      <PoScheduleOriginalRequestQuantity>$null</PoScheduleOriginalRequestQuantity>
      <PoScheduleOriginalRequestDate>$null</PoScheduleOriginalRequestDate>
      <PoScheduleCarrier>$null</PoScheduleCarrier>
      <PoScheduleCarrierMode>$null</PoScheduleCarrierMode>
      <PoScheduleCarrierAccountNumber>$null</PoScheduleCarrierAccountNumber>
      <PoScheduleCustomerSiteName>5302</PoScheduleCustomerSiteName>
      <PoScheduleShipToAddressDescriptor>$null</PoScheduleShipToAddressDescriptor>
      <PoScheduleShipToAddressAddress1>$null</PoScheduleShipToAddressAddress1>
      <PoScheduleShipToAddressAddress2>$null</PoScheduleShipToAddressAddress2>
      <PoScheduleShipToAddressCity>$null</PoScheduleShipToAddressCity>
      <PoScheduleShipToAddressCountry>$null</PoScheduleShipToAddressCountry>
      <PoScheduleShipToAddressCounty>$null</PoScheduleShipToAddressCounty>
      <PoScheduleShipToAddressState>$null</PoScheduleShipToAddressState>
      <PoScheduleShipToAddressZip>$null</PoScheduleShipToAddressZip>
      <PoScheduleLastModifiedDate>$null</PoScheduleLastModifiedDate>
      <PoScheduleCustomerMessage>$null</PoScheduleCustomerMessage>
      <PoScheduleSupplierMessage>$null</PoScheduleSupplierMessage>
      <PoScheduleRefdPoCustomerName>$null</PoScheduleRefdPoCustomerName>
      <PoScheduleRefdPoS>$null</PoScheduleRefdPoS>
      <PoScheduleRefdPoModelSubType>$null</PoScheduleRefdPoModelSubType>
      <PoScheduleRefdPoNumber>$null</PoScheduleRefdPoNumber>
      <PoScheduleRefdPoLineItemId>$null</PoScheduleRefdPoLineItemId>
      <PoScheduleRefdPoScheduleId>$null</PoScheduleRefdPoScheduleId>
      <UDFPoSchedulescheduleUDF1>$null</UDFPoSchedulescheduleUDF1>
      <UDFPoSchedulescheduleUDF2>$null</UDFPoSchedulescheduleUDF2>
      <UDFPoSchedulescheduleUDF3>$null</UDFPoSchedulescheduleUDF3>
      <UDFPoSchedulescheduleUDF4>$null</UDFPoSchedulescheduleUDF4>
      <UDFPoSchedulescheduleUDF5>$null</UDFPoSchedulescheduleUDF5>
      <PoPromiseScheduleId>1</PoPromiseScheduleId>
      <PoPromiseScheduleAddressDescriptor>$null</PoPromiseScheduleAddressDescriptor>
      <PoPromiseScheduleAddress1>$null</PoPromiseScheduleAddress1>
      <PoPromiseScheduleAddress2>$null</PoPromiseScheduleAddress2>
      <PoPromiseScheduleAddressCity>$null</PoPromiseScheduleAddressCity>
      <PoPromiseScheduleAddressCountry>$null</PoPromiseScheduleAddressCountry>
      <PoPromiseScheduleAddressCounty>$null</PoPromiseScheduleAddressCounty>
      <PoPromiseScheduleAddressState>$null</PoPromiseScheduleAddressState>
      <PoPromiseScheduleAddressZip>$null</PoPromiseScheduleAddressZip>
      <PoPromiseScheduleQuantity>9.000</PoPromiseScheduleQuantity>
      <PoPromiseScheduleDate>16Sep2006000000</PoPromiseScheduleDate>
      <PoPromiseScheduleShipmentDate>$null</PoPromiseScheduleShipmentDate>
      <UDFPoPromiseScheduleUDF1>$null</UDFPoPromiseScheduleUDF1>
      <UDFPoPromiseScheduleUDF2>$null</UDFPoPromiseScheduleUDF2>
      <UDFPoPromiseScheduleUDF3>$null</UDFPoPromiseScheduleUDF3>
      <UDFPoPromiseScheduleUDF4>$null</UDFPoPromiseScheduleUDF4>
      <UDFPoPromiseScheduleUDF5>$null</UDFPoPromiseScheduleUDF5>
      </data>
    - <FileNameNode>
      <FileName>111111111_222222223_purchase-orders_20060901065147_</FileName>
      </FileNameNode>
      </recordset>
      </ns0:MT_PurchaseOrderChange>
    I have specifed
    Payload:MT_PurchaseOrderChange,1,FileNameNode,1,FileName,1
    in variable substitution
    I am on SP 14 and it the dynamic file is working for other scneario
    bt in this scneario i am getting the error
    Receiver Adapter v2405 for Party '', Service 'com_E2open_qas':
    Configured at 2006-09-01 18:42:32 GMT+05:30
    History:
    - 2006-09-01 19:11:48 GMT+05:30: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: amit
    - 2006-09-01 19:11:48 GMT+05:30: Processing started
    - 2006-09-01 19:06:47 GMT+05:30: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: amit
    - 2006-09-01 19:06:47 GMT+05:30: Processing started
    - 2006-09-01 19:01:47 GMT+05:30: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: amit
    amit is the variable i have given for substitution.

    Hi,
    if you have SP14 stop using variable substitiuion:)
    you can do it much easier with dynamic configuraiton
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    so you can easily set it for file adapter to set the file name
    you can also have a look at my weblog:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • How to get the original file name in chinese with upload component?

    It is inconvenience for user to upload file with name only in english. When upload a file with chinese file name, the file name gotten from "fileUpload1.getUploadedFile().getOriginalName()" is just like "&#32515;&#25120;&#31926;&#37733;&#65533;.jpg". Do somebody have a good idea?

    I spoke to the component engineers regarding this issue
    First please check if the s page encoding is set correctly, as browsers tend to default to use the encoding that was used for the page when submitting the request.
    (Because of how the JSF response writer is written, multibyte characters can be written correctly even if the encoding is not set correctly so the fact that form correctly rendered chinese characters is not proof that the encoding was set correctly).
    If you established that the page encoding is correct, then there is a
    bug in the FileUpload. The method that gets the name is a straight
    shot through to an Apache FileUpload library method. Technically this
    ought to be resolved by that method checking the request body
    character set before parsing the parameters.
    - Winston
    http://blogs.sun.com/roller/page/winston?catname=Creator

  • Non US-ASCII characters in download file names

    I am trying to implement a simple file download in a JSP, and trying to get IE, Firefox and Opera to all display and handle non US-ASCII characters in the suggested download file name. Only concerned with Windows platform for now. Here's the code I am currently using:
    String agent = request.getHeader("USER-AGENT");
    if (null != agent && -1 != agent.indexOf("MSIE"))
    String codedfilename = URLEncoder.encode(cfrfilename, "UTF8");
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + codedfilename);
    else if (null != agent && -1 != agent.indexOf("Mozilla"))
    String codedfilename = MimeUtility.encodeText(cfrfilename, "UTF8", "B");
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + codedfilename);
    else
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + cfrfilename);
    }This URL encodes the file name if the browser is IE, MIME encodes it if the browser is Mozilla, and sends plain UTF-8 (the encoding of the JSP) for all other browsers. I get "cfrfilename" from translated properties files, and the string can contain characters from any character set - Chinese, Thai, Korean, etc.
    This code works correctly for IE - the file name is displayed correctly in the file Save as dialog, and it is saved correctly on disk, no matter which character set is used.
    For Firefox, the file name is displayed correctly in the file Save as dialog, but it is only saved correctly to disk if the file name is in a character set supported by the system locale. This seems to be a known Firefox bug (not fully using the Windows Unicode APIs), so nothing I can do about that.
    Nothing seems to work for Opera, however - I cannot get the file name to display correctly in the file Save as dialog, no matter which method I use (I have tried URL encoding and MIME encoding in addition to the plain UTF-8).
    Has anybody implemented something similar that works for at least these 3 browsers?

    I tested your code today,
                         dialog           save           open
    Firefox 1.5          OK                 OK               OK
    IE 6.0                OK                 OK                NGdailog: filename show in download popup dialog
    save: save to disk from dialog
    open: open directly from dailog

Maybe you are looking for

  • Is there a way of getting iphoto to check for duplicates?

    i am a comparatively new user to macs and it seems that as i synch my i phone to my mac i am getting the same events imported again into iphotos -   i have been merging these events rather than have duplicate events ... but there are inevitable dupli

  • Activation of update rule :Help Required Urgently!!

    Hi I am not able to activate an update rule from an ods to cube. In the start routine I am populating ITAB with amt when I add the following code in the update routine for amt : READ TABLE ITAB WITH KEY RECORD_NO. RESULT = ITAB-AMT. I am unable to ac

  • Purchase Info record conditions Validity Period

    Hi, In the Inforecord ME12/ME13 the conditions are displayed with validity period which are shown in ascending order. Example 23.10.2008 to 31.10.2008 01.11.2008 to 30.06.2009 01.07.2009 to 31.10.2009 01.11.2009 to 31.12.9999 The required display or

  • This Should Be Called User Error Discussion

    I received my 60 gb black ipod this morning. I successfully loaded about 25 gb worth of music in about a half hour to 45 minutes. I also loaded the entire family guy that i encoded in videora ipod coverter, settings sp/320x240/768 kps stereo/128kps.

  • Run report in Oracle Application from command line

    Hi All, I have a requirement that i have to generate a report through command line and save the output as pdf in a folder on the server. How can i achieve this task. Is any body have some idea plz reply quickly. We have a UAT at 10th of this month. T