GetFirstFile() and non-english chars

Hi,
When using GetFirstFile() / GetNextFile(), if a file is encountered with Chinese chars in it's filename, each of these chars is replaced with a "?".
As a result, I cant open the file as I dont know its full name.
Does anyone know of a way around this? Some Windows SDK function maybe?
cheers,
Darrin.

Hi Diz@work,
Thanks for posting on the NI Discusson Forums. 
I have a couple questions for you in order to troubleshoot this issue:
Which language is your Windows operating system set to? Chinese or English?
When you say that the filename returned contains '?' characters instead of the Chinese characters, do you mean you see this when you output to a message popup panel or print to the console? Are you looking at the values in fileName as you're debugging? Can you take a look at the actual numerical values in the fileName array and see which characters they map to? It's possible that the Chinese characters are being returned correctly, but the function you're using to output them doesn't understand the codes they use.
Which function are you using to open the file with the fileName you get from GetFirstFile()? Can you take a look at what's being passed to it?
CVI does include support for multi-byte characters. Take a look at this introduction:
http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/programmerref/programmingmultibytechars/
As far as the Windows SDK goes, I did find that the GetFirstFile() and GetNextFile() functions are based on the Windows functions, FindFirstFile() and FindNextFile(). According to MSDN, these functions are capable of handling Unicode characters as well as ASCII:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx
There may be a discrepancy between how these functions are being called and/or what they're returning to the CVI wrapper functions.
Frank L.
Software Product Manager
National Instruments

Similar Messages

  • Reading .txt file and non-english chars

    i added .txt files to my app for translations of text messages
    the problem is when i read the translations, non-english characters are read wrong on my Nokia. In Sun Wireless Toolkit it works.
    See the trouble is because I don't even know what is expected by phone...
    UTF-8, ISO Latin 2 or Windows CP1250?
    im using CLDC1.0 and MIDP1.0
    What's the rigth way to do it?
    here's what i have...
    String locale =System.getProperty("microedition.locale");
    String language = locale.substring(0,2);
    String localefile="lang/"+language+".txt";
    InputStream r= getClass().getResourceAsStream("/lang/"+language+".txt");
    byte[] filetext=new byte[2000];
    int len = 0;
    try {
    len=r.read(filetext);
    then i get translation by
    value = new String(filetext,start, i-start).trim();

    Not sure what the issue is with the runtime. How are you outputing the file and accessing the lists? Here is a more complete sample:
    public class Foo {
         final private List colons = new ArrayList();
         final private List nonColons = new ArrayList();
         static final public void main(final String[] args)
              throws Throwable {
              Foo foo = new Foo();
              foo.input();
              foo.output();
         private void input()
              throws IOException {
             BufferedReader reader = new BufferedReader(new FileReader("/temp/foo.txt"));
             String line = reader.readLine();
             while (line != null) {
                 List target = line.indexOf(":") >= 0 ? colons : nonColons;
                 target.add(line);
                 line = reader.readLine();
             reader.close();
         private void output() {
              System.out.println("Colons:");
              Iterator itorColons = colons.iterator();
              while (itorColons.hasNext()) {
                   String current = (String) itorColons.next();
                   System.out.println(current);
              System.out.println("Non-Colons");
              Iterator itorNonColons = nonColons.iterator();
              while (itorNonColons.hasNext()) {
                   String current = (String) itorNonColons.next();
                   System.out.println(current);
    }The output generated is:
    Colons:
    a:b
    b:c
    Non-Colons
    a
    b
    c
    My guess is that you are iterating through your lists incorrectly. But glad I could help.
    - Saish

  • Problem with Freehand eps and non english char

    HI, I'm new in this forum and newbie in Freehand
    I'm trying to make a eps file with Freehand. This eps is for faxcover, I make it and works fine, but the problem is when I want to use a special charcater, non englis, for example Ñ.
    Somebody knows how can I do to when I make the eps in Freehand permit special characters?
    Any idea?
    Thanks

    Special characters can't be done as FreeHand doesn't support unicode (extended letters with accents, etc)
    This may help: http://freefreehand.org/forum/viewtopic.php?f=5&t=268

  • [SOLVED] Non english chars kdemod 4 problem

    Hello, I have a little problem with KDE and the non english charactes.
    If I open a file with non english chars in its name I get something like this:
    (In this case kwrite opens "other" file but in other applications it fails with an error of file not found)
    Other sympton is that in KDE menu my name have bad chars too:
    (It must be López)
    And the third sympton is that if try to rename a file in the desktop, I can't write accented chars (á é í ó ú). At the begining the keyboard in this rename dialog was totally in english but i have got a semi spanish keyboard (i can write ñ letters) with the apropiate /etc/hal/fdi/policy/10-keymap.fdi file.
    But the most strange is that in general, in all Kde and non-kde applications and even in the console, non english chars works ok. I can go to the file->Open menu of the application and open a file with non english chars in its name. The problem seems to reside in the part of kde that passes the name of the file to the application (¿kwin?)
    my locale is es_ES@UTF8 and as I said I have configured correctly the 10-keymap.fdi file.
    I have read in some forums that something like this could be a kde or qt bug, but for me it's not clear as i don't see a general complaining about this.
    Any idea will be apreciated.
    Thanks in advance,
    Christian.
    Last edited by christian (2009-03-27 14:52:17)

    SanskritFritz wrote:
    That should be "es_ES.utf8"
    Sorry, i mispelled it in the post.
    Of course, my locale is es_ES.utf8:
    LANG=es_ES.utf8
    LC_CTYPE="es_ES.utf8"
    LC_NUMERIC="es_ES.utf8"
    LC_TIME="es_ES.utf8"
    LC_COLLATE=C
    LC_MONETARY="es_ES.utf8"
    LC_MESSAGES="es_ES.utf8"
    LC_PAPER="es_ES.utf8"
    LC_NAME="es_ES.utf8"
    LC_ADDRESS="es_ES.utf8"
    LC_TELEPHONE="es_ES.utf8"
    LC_MEASUREMENT="es_ES.utf8"
    LC_IDENTIFICATION="es_ES.utf8"
    LC_ALL=
    I don't think this could be the source of the problem, because, except in the places I said in the firs post, the rest of my system works perfectly.

  • How to load file thru reader which contains non-english char in file name

    Hi ,
    I want to know how to load file in english machine thru reader which contains non-english chars in file names (eg. 置顶.pdf)
    as LoadFile gives error while passing unicode converted file name.
    Regards,
    Arvind

    You don't mention what version of Reader?  And you are using the AcroPDF.dll, yes?
    Sent from my iPad

  • How can the symbol and non-English diacritical marking, etc accessed with combinations of letters and functional keys prior to Snow Leopard be achieved in Snow Leopard?

    How can the symbol and non-English diacritical marking/punctuation pallet, available in pre-Snow Leopard OSes with various combinations of letter or number keys and functional keys, be accessed in Snow Leopard?  Those pre-Snow Leopard versions worked on the fly as one was making text in any pedestrian application and its native font (Mail, Text Edit, for example).  One didn't need to dig around in font libraries, change font preferences, etc.

    > One didn't need to dig around in font libraries, change font
    > preferences, etc.
    It hasn't worked like that since the Early Chalcolithic (ie, System 7 or thereabouts).
    You've already got plenty of answers. Briefly (and grossly oversimplified),
    - Mac OS X conforms to a standard known as Unicode; in its current incarnation, it defines over 100k characters.
    - A keypress is translated into a character according to the current keyboard layout.
    - The graphic representation of a character (ie, glyph), is provided by the current font.
    - If a font lacks a glyph for the requested character, either another font will be automatically chosen (Mac OS X text engine), or some form of feedback (empty box, question mark, etc) will be used.
    - To inspect the actual key codes, use a utility such as Key Codes.
    - To inspect the current keyboard layout, invoke Keyboard Viewer.
    - To inspect the full complement of glyphs of a font, invoke Character Viewer (also accessed with the Special Characters command).
    (Remember that both these utilities are resizable and zoomable -- you can enlarge them to a comfortable viewing size, then zoom out to see more of the screen for your original task.)
    - For a more detailed look, use a utility such as UnicodeChecker.
    - The default keyboard layout depends on your Mac OS X localisation.
    (Keep in mind that there's no need to stick with the default layout; choose whichever one makes sense to you, given your language, habits, and proclivities. Mac OS X comes bundled with quite a few, including some obviously designed for the huddled masses of refugees from the Dark Side, who, in their wretched ignorance, have the unmitigated gall of labelling our native ways "really uncomfortable". Oh well, this, too, shall pass.
    If none of the supplied keyboard layouts fits your needs -- if, for instance, you write your emails in Etruscan -- go out on the 'net, you'll find quite a few. Or write your own with Ukulele, it's not really all that difficult.)
    - Use Keyboard Viewer to familiarise yourself with the current layout and to enter the odd character; but, to be proficient, you should learn your layout to the point that KV is no longer needed.
    - Use Character Viewer to enter the odd character not available in the current keyboard layout.
    Neither Keyboard Viewer nor Character Viewer are effective tools for more extensive needs, eg, for writing and editing bilingual or multilingual texts. In such a case, you should enable the respective keyboard layouts and switch between them with a keyboard shortcut.
    A few interesting layouts bundled with Mac OS X have already been mentioned. Let me add three.
    - Dvorak: several layouts based on the Dvorak keyboard. It is claimed that the latter is more productive and lessens RSI risk.
    - US Extended: based on QWERTY, it offers a more extensive set of diacritics (eg, caron, breve) via dead keys.
    - Unicode Hex Input: also based QWERTY, it allows input by Unicode codepoint (in hexadecimal), so it's the most extensive layout of all; eg, to enter the character "Parenthesized Number Twelve" (U+247F), hold down Option, type "247f", release Option.

  • How can build help file for right to left and non english language

    hi erverybody, i have a big problem ,please help me
    i creat a c# appliction with vs.net2005 and i want to write
    help file for it .i need a software to creat help file for non
    english language(such as persian or arabic) and right to left
    support . i tried many helpware chm builder tools but each of them
    made a problem .i dont know what to do .what is the best solution
    for creating help files for right to left and non english languages
    how can i build my help file with f1 helping ability .thank u
    so much
    Text

    Hi Mr_Sia and welcome to the RH community.
    You could try looking at the HAT Matrix. This is a comparison
    of all the help tools around. Click
    here to go to it.
    RoboHelp itself, whilst it does support over 35 different languages
    does not support Persian or Arabic.

  • Lion OS and Non-English langugae

    Hi There,
    I have some issues with Lion OS and non-english language like arabic. for instance when I want to go through some websitel like مهاجرت به کانادا and کانادا مهاجرت and مهاجرت کانادا and اقامت کانادا I run into some messy words and when I check with snow leopard, every thing work perfectely. How can I figure that out?
    Thank you

    Could you send me a screen shot of what you mean by "messy words"?
    If you are using Safari, do you have the same problem with FireFox?

  • [SOLVED!] On USB drives, problems with non-English chars and HAL

    Hello,
    I am having a problem with non-English caracters (áãàçéẽê...) on files stored on my USB drive.
    On Windows they're created with the correct name. But on Linux the files have the non-English characteres replaced by '?' and are not accessible.
    If I manuallly mount the drives using 'mount -o iocharset=utf8 /dev/sdb1 /media/usbdisk' the characters are OK, so I think I just need to get HAL to pass the correct parameters to mount. However I don't know how to do that, and haven't found any good solution.
    I tried to build a custom kernel setting the default charset as UTF-8 and it didn't work.
    Any ideas? I'm using x86-64, HAL 0.5.13-3 and my locale is pt-BR.UTF-8.
    Thanks!
    EDIT: Actually, this is not a HAL problem, but a problem with 'exo'. For the solution, I edited /etc/xdg/xfce4/mount.rc and added iocharset=utf8 to the [vfat] category.
    Last edited by Renan Birck (2009-11-28 20:54:23)

    I don't use Thunar presently, but I looked in the Thunar Volume Manager doc and I didn't find anything to change the mount options of removable drives. I am not quite sure if it's possible or not. Maybe someone using it can tell for sure.
    But if it is not possible to change the mount options, a possible solution is to disable the Thunar Volume Manager plugin and to use something else more configurable to manage the automount function.
    Personally I use the halevt package from AUR which uses configuration files in the xml format.
    It's not so easy to use but is highly configurable.
    But there exists other tools also.
    I can help you with halevt if you choose that way...

  • 'Chinese letters' printed instead of non-english chars

    Hi ,
    I use a cmd in which i execute the java programs i have developed... Whereas , i write non-english(greek) letters in my source programs the cmd does not display them....only 'chinese letters or non-understandable symbols'...
    Of course... i can write greek letters in the cmd....
    Is there something that i can do except for writing the messages with english/latin ...chars???
    Note:I use Win XP and jdk 1.4
    Thanks,
    Sim

    public class switchPr
    public static void main(String[] args)
      int a=(int)(12*Math.random());
      switch (a)
       case 1:
         System.out.println("Ιανουάριος");
         break;
       case 2:
         System.out.println("Φεβρουάριος");
         break;
       case 3:
         System.out.println("Μάρτιος");
         break;
       case 4:
         System.out.println("Απρίλιος");
         break;
       default:
          System.out.println("other...");
         break;
    C:\oracle_files\Java\Examples\switch>C:\oracle\product\10.2.0\database10g\jdk\bi
    n\javac -classpath . switchPr.java
    C:\oracle_files\Java\Examples\switch>C:\oracle\product\10.2.0\database10g\jdk\bi
    n\java -classpath . switchPr
    other...
    C:\oracle_files\Java\Examples\switch>C:\oracle\product\10.2.0\database10g\jdk\bi
    n\java -classpath . switchPr
    other...
    C:\oracle_files\Java\Examples\switch>C:\oracle\product\10.2.0\database10g\jdk\bi
    n\java -classpath . switchPr
    ╔άΊΎΫ▄?ώΎ≥The line just above is non-understandable..... Can you decrypt it...???
    Greetings...

  • Cfqueryparam and non-English languages

    Hi,
    I want to store non-English characters in NCHAR NVARCHAR and
    NTEXT field types.
    In the examples below fields LastName and FirstName are
    NVARCHAR type and
    Comments is NTEXT
    In the past when I wanted to store non English (Greek)
    strings or texts in these field types I was writting
    <!-------------->
    <cfquery name="Q" datasource="Db">
    INSERT INTO Books
    ( LastName,
    FirstName,
    Comments )
    VALUES
    ( N '#var_LastName#' ,
    N '#var_FirstName#' ,
    N '#var_Comments#' )
    </cfquery>
    <!-------------->
    Now I want to use the cfqueryparam, so the syntax is
    <!-------------->
    <cfquery name="Q" datasource="Db">
    INSERT INTO Books
    ( LastName,
    FirstName,
    Comments )
    VALUES
    ( <cfqueryparam value="#var_LastName#"
    cfsqltype="CF_SQL_VARCHAR" MaxLength="40">,
    <cfqueryparam value="#var_FirstName#"
    cfsqltype="CF_SQL_VARCHAR" MaxLength="30">,
    <cfqueryparam value="#var_Comments#"
    cfsqltype="CF_SQL_LONGVARCHAR"> )
    </cfquery>
    <!-------------->
    but ...... the non English characters are not stored
    correctly.
    So my question is
    How can I use the cfqueryparam in order to store non English
    characters in NCHAR NVARCHAR and NTEXT field types ???
    The documentation has not any info on that.
    Thank you in advance for your help
    ANX
    Greece

    You didn't say what version of CF you were using.
    Also, which database driver are you using (ODBC or JDBC
    version #)?
    Anyway, it looks like you do not have the unicode support
    turned on. See
    http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=entry&entry=F9553D86-20ED-7DEE-2A 913AFD8651643F,
    etc.
    If that doesn't help, post
    sample data that inserts ok without cfparam but not ok with
    cfparam.

  • Search for description containing non-English chars -- ?

    Hello!
    I've implemented a search class, which allows customers to search folders/documents by name, owner, description, etc.
    And here's the problem: if description contains non-English (Russian, in my case) characters, search does not work! Everything (AS infrastructure, CM SDK DB, etc) was installed using UTF-8 Unicode charset. When I debug the code, I see that when I build AttributeQualification and later compose a comples SearchQualification, value in these is correct, but when I call getSQL(), I see string like this:
    ... ( nls_upper(ALIASDOCUMENT.DESCRIPTION) LIKE nls_upper('????') ) ...
    So it seems as if SQL converted passed UNICODE value into ANSI string, and since server's system language is English, my Russian letters were lost -- ?
    Can anybody shed some light here? Is there a way to search for UNICODE descriptions (and content, for that matter)?
    Thanks,
    Sasha.

    Hi Sasha,
    I want you to try the following code. It should output the file description and query to a text file. Use internet explorer / or notepad to open this file and ****specify that the file encoding is UTF8.*****
    thanks,
    matt.
    java -classpath ...blah blah.. RussianSearch parameterfile=c\cmsdkparameters.txt
    cmsdkparameters.txt contains:
    Username = system
    Password = oracle9i
    SchemaPassword = cmsdk
    Domain = ifs://ifspm-sun2.us.oracle.com:1521:mjs92.us.oracle.com:cmsdk903
    ServiceConfiguration = SmallServiceConfiguration
    Service = TestService
    import oracle.ifs.beans.LibraryService;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.ClassObject;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.DocumentDefinition;
    import oracle.ifs.beans.Folder;
    import oracle.ifs.beans.FolderDefinition;
    import oracle.ifs.beans.LibraryObject;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.Search;
    import oracle.ifs.beans.SearchResultObject;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.common.AttributeValue;
    import oracle.ifs.common.CleartextCredential;
    import oracle.ifs.common.Credential;
    import oracle.ifs.common.ParameterTable;
    import oracle.ifs.search.AttributeQualification;
    import oracle.ifs.search.AttributeSearchSpecification;
    import oracle.ifs.search.SearchClassSpecification;
    import oracle.ifs.search.SearchSortSpecification;
    import java.io.FileOutputStream;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.util.Hashtable;
    import java.util.Vector;
    * Copyright (c) 2003 Oracle Corporation. All rights reserved.
    * Matt Shannon.
    * Description:
    *  Test searching in Russian Language
    *  View output file in notepad or IE - make sure to specify character
    *  set of document to be UTF8 when opening.
    public class RussianSearch implements Runnable
      // set to 'false' to prevent the class from freeing objects that it creates
      public static final boolean performCleanup = true;
      protected ParameterTable m_parametertable;
      private Vector m_ObjectsRequiringCleanup; 
      public RussianSearch(String[] args)
        // parameter file is retrieved through command line argument parameterfile=
        m_parametertable = new ParameterTable(args, "parameterfile");
      public static void main(String[] args)
        new Thread(new RussianSearch(args)).start();
       *   This is where you write your test program.
      public void run()
        LibraryService service = startService();
        LibrarySession session = establishSession(service);
        if (session == null)
          return;
        try
          DocumentDefinition ddef = new DocumentDefinition(session);
          ddef.setAttribute(PublicObject.NAME_ATTRIBUTE,
            AttributeValue.newAttributeValue("blah.txt"));
          ddef.setAttribute(PublicObject.DESCRIPTION_ATTRIBUTE,
            AttributeValue.newAttributeValue("&#1071; &#1089;&#1082;&#1091;&#1095;&#1072;&#1102; &#1087;&#1086; &#1088;&#1086;&#1076;&#1080;&#1085;&#1077;"));
          ddef.setEmptyContent();
          Document newdoc = (Document) session.createPublicObject(ddef);
          addObjectRequiringCleanup(newdoc);
          /*  Construct AttributeSearchSpecification.
           *  Attribute based conditions are allowed, context conditions are not!
          AttributeSearchSpecification attrSrchSpec =
            new AttributeSearchSpecification();
          /*  Construct SearchClassSpecification.
           *  This represents the FROM and SELECT clauses of the query.
          SearchClassSpecification srchClsSpec = new SearchClassSpecification();
          srchClsSpec.addSearchClass(Document.CLASS_NAME);      // from clause
          srchClsSpec.addResultClass(Document.CLASS_NAME);      // select clause
          /*  Construct SearchSortSpecification.
           *  This represents the ORDER BY clause of the query.
          SearchSortSpecification srchSortSpec = new SearchSortSpecification();
          //  upper case ascending sort on Name
          srchSortSpec.add(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE,
            SearchSortSpecification.ASCENDING, "nls_upper");
          /*  AttributeQualification is a WHERE clause component representing an
           *  attribute condition.
          // scalar AttributeQualification - name like '%.html'
          AttributeQualification aq = new AttributeQualification();
          aq.setAttribute(Document.CLASS_NAME, PublicObject.DESCRIPTION_ATTRIBUTE);
          aq.setOperatorType(AttributeQualification.LIKE);
          aq.setValue("%&#1088;&#1086;&#1076;&#1080;&#1085;&#1077;");
          // set SELECT & FROM clauses
          attrSrchSpec.setSearchClassSpecification(srchClsSpec);
          // set ORDER BY clause
          attrSrchSpec.setSearchSortSpecification(srchSortSpec);
           // set WHERE clause
          attrSrchSpec.setSearchQualification(aq);
          /* Construct Search, supply SearchSpecification */
          Search s = new Search(session,attrSrchSpec);
          System.out.println("File encoding system property: "+System.getProperty("file.encoding"));
          boolean append = false;
          FileOutputStream fos = new FileOutputStream("c:/test.txt",append);
          OutputStreamWriter osw = new OutputStreamWriter(fos);
          System.out.println("Default character encoding: "+osw.getEncoding());
          osw = new OutputStreamWriter(fos,"UTF8");
          System.out.println("New character encoding: "+osw.getEncoding());
          PrintWriter out = new PrintWriter(osw,true);
          out.println(s.getSQL());
          SearchResultObject obj = null;
          // Open Search!
          s.open();
          try
             * A SearchResultObject encapsulates a row of a search result.  It
             * contains 1 or more LibraryObjects (depending on number of result
             * classes specified).
            while ( (obj = s.next()) != null )
              Document d = (Document)(obj.getLibraryObject(Document.CLASS_NAME));
              out.println(d.getName() + " " + d.getDescription());
          catch (Throwable e)
            if  ((e instanceof IfsException) &&
              (((IfsException)e).containsErrorCode(22000)))
            else
              System.out.println("Unexpected exception occurred in selector cursor");
              System.out.println((e instanceof IfsException)
                ? ((IfsException)e).toLocalizedString()
                : e.toString());
          finally
            out.close();
            if (performCleanup)
              cleanup();
            s.close();
            s.dispose();
        catch (Throwable e)
          System.out.println("Fatal exception occurred in run():");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        finally
          disconnectSession(session);
      public LibraryService startService()
        String schemapassword = m_parametertable.getString("SchemaPassword");
        String domain = m_parametertable.getString("Domain");
        String servicename = m_parametertable.getString("Service",domain);
        String serviceconfiguration =
          m_parametertable.getString(
            "ServiceConfiguration","SmallServiceConfiguration"
        LibraryService service = null;
        try
          if (servicename != null &&
            LibraryService.isServiceStarted(servicename))
            // The service name was specified, and is already running.
            // So just use it.
            System.out.println("Service already running: "+servicename);
            service = LibraryService.findService(servicename);
            System.out.println("Existing service retrieved");
          else
            service = LibraryService.startService(
              servicename, schemapassword, serviceconfiguration, domain);
            System.out.println("Service started: '"+servicename+
              "' (version: "+service.getVersionString()+")");
        catch (Throwable e)
          System.out.println("Unable to start service:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        return service;
      public LibrarySession establishSession(LibraryService service)
        String username = m_parametertable.getString("Username");
        String password = m_parametertable.getString("Password");
        return establishSession(service, username, password);
      public LibrarySession establishSession
        LibraryService service,
        String username,
        String password
        LibrarySession session = null;
        try
          CleartextCredential cred = new CleartextCredential(username,
            password);
          session = establishSession(service, cred);
        catch (Throwable e)
          System.out.println("Unable to create credential:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        return session;
      public LibrarySession establishSession
        LibraryService service,
        Credential cred
        LibrarySession session = null;
        if (service != null)
          try
            String username = cred.getName();
            session = service.connect(cred, null);
            System.out.println("Session established for " + username);
          catch (Throwable e)
            System.out.println("Unable to create session:");
            System.out.println((e instanceof IfsException)
              ? ((IfsException)e).toLocalizedString()
              : e.toString());
        return session;
      public void disconnectSession(LibrarySession session)
        System.out.println("Disconnecting session");
        try
          session.disconnect();
        catch (Throwable e)
          System.out.println("Error disconnecting session:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
      public void addObjectRequiringCleanup(LibraryObject lo)
        Vector v = getObjectsRequiringCleanupVector();
        v.addElement(lo);
      private Vector getObjectsRequiringCleanupVector()
        if (m_ObjectsRequiringCleanup == null)
          m_ObjectsRequiringCleanup = new Vector();
        return m_ObjectsRequiringCleanup;
       * Frees objects that were marked as requiring clean up
      public void cleanup()
        Vector v = getObjectsRequiringCleanupVector();
        System.out.println("Cleanup - delete objects created during the session");
        int count = (v == null) ? 0 : v.size();
        System.out.println("# of objects to free: "+count);
        // Free the objects in reverse order from which they were added
        for (int i = count - 1; i >= 0; i--)
          LibraryObject lo = (LibraryObject)v.elementAt(i);
          try
            discardObject(lo);
          catch (Exception e)
            System.out.println("Unable to discard an object during cleanup - continuing...");
      public void discardObject(LibraryObject lo) throws IfsException
        if (lo != null)
          try
            System.out.println("Attempting to free: "+getDisplayName(lo));
            LibrarySession session = lo.getSession();
            if (lo instanceof Folder)
              System.out.println("Attempting to free Folder with Deep Option!");
              // free Folder using "Deep" option to free
              // all items in the folder, and all of their items, etc.
              Folder folder = (Folder)lo;
              FolderDefinition def = new FolderDefinition(session);
              def.setFolderDepthOption(
                Folder.SYSTEMOPTIONVALUE_FOLDER_DEPTH_DEEPEST);
              folder.free(def); // removes object from the repository, with options
            else
              // just a regular free
              lo.free();
          catch (Exception e)
            System.out.println("Unable to free an object during cleanup - continuing");
            System.out.println((e instanceof IfsException)
              ? ((IfsException)e).toLocalizedString()
              : e.toString());
      public String getDisplayName(LibraryObject lo)
        throws IfsException
        String displayName;
        if (lo != null)
          displayName = lo.getClassObject().getName()
            + " '" + lo.getName() + "'";
        else
          displayName = "<null object>";
        return displayName;
    }

  • Problem with Vcard and non-English character

    VCard feature is what I would like to use, but I have quite a few contacts with Non-English name (Korean).
    I know Ipod can display in Korean, but when I create a v-card with Korean character and copy the vcard file over into /contacts folder, I can see the filename as the person's name (From windows explorer), but I can ONLY see first character of the file when I display contacts in iPod.
    Does anyone have tips/tricks on displaying all the filename in IPod contacts?
    Thanks.
      Windows XP Pro  

    Because i use the string nota into a jsp page and i print the string nota into a textarea and the text is with no newline, example:
    <textarea name="nota" rows="4" cols="60"><%= nota %></textarea>
    the text into textarea is:
    first linesecond linethird line
    but i want that the text displayed into textarea is equal the text into the CDATA section:
    first line
    second line
    third line

  • Flex, xml, and non-English characters

    Hello! I have a Flex web app with AdvancedDataGrid. And I use httpService component to load some data to grid. The .xml file contains non-english characters in attributes (russian in my case) like this:
    <?xml version="1.0" encoding="utf-8" ?>
       <Autoparts>
        <autopart  DESCRIPTION="Барабан">
    </Autoparts>
    And when i run app, AdvancedDataGrid display it like "Ñ&#129;ПÐ". How can i fix it? I try to change encoding="utf-8" with some another charsets, bun unsuccesfully. Thank you.

    Try changing the xml structure by using CDATA instead of having the russian part as an attribute and see if that makes any difference.
    What I meant is use something like this:
    <?xml version="1.0" encoding="utf-8" ?>
       <Autoparts>
        <autopart>
           <description><![CDATA[Барабан]]></description>
      </autopart>
    </Autoparts>
    instead of the current xml.

  • Cfimage and non-english characters

    I've been googling for hours and just can not find anything
    related to this, very strange, I am trying to use ImageDrawText
    draw Chinese onto an image but could never get it to work, tried so
    many things, setting the page encoding to UTF-8, cfcontent,
    setEncoding etc., it displays the Chinese fine on the page, but
    passing it to the ImageDrawText method, writetobrowser gives me an
    image with all square boxes instead of the chinese characters.
    anyone else having same problem with other non-english
    languages?
    thanks

    edwardch wrote:
    > thanks, tried Arial unicode MS, but unfortunately my
    hosting server doesn't
    > have the font :(, CF gives an error: Unable to find
    font: Serif.
    serif? not sure where that's coming from. can you try "@Arial
    Unicode MS"?
    unfortunately this is image work so you *have* to have a
    unicode capable font
    physically available (unlike PDF/flashpaper where you might
    "poke & hope" that
    the font's on the client & simply not embed the font).
    > Have also tried Lucida Sans Unicode, doesn't work for
    Chinese.
    no it doesn't.
    > and can't find the Arial unicode MS.ttf file, even if I
    have the file, how can
    > I install it using coldfusion codes?
    you can't, either have to add it via windows control panel
    (or whatever for
    linux) or via cfadmin font management. see these for
    potential fonts, etc.
    http://en.wikipedia.org/wiki/Arial_Unicode_MS
    http://en.wikipedia.org/wiki/Free_software_Unicode_typefaces
    http://en.wikipedia.org/wiki/Unicode_typefaces
    http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&cat_id=FontDownloads
    or you might simply ask your host what fonts are on the
    server that can support
    chinese.

Maybe you are looking for

  • Error while updating rg1 in j1i5

    Hi Experts, I am updating rg1 for one of our plant with t.code J1I5 with classification RMA. Error coming-  Maintain the chapter ID for material SPA000003331 J_1IMTCHID Message no. 8I001 But this material is non-excisable..so i can nt maintain chaper

  • The iPod "Daniel's iPod" cannot be synced. An unknown error occured (-4).

    "The iPod 'Daniel's iPod' cannot be synced. An unknown error occured (-4)." is the message i get when i press the sync button. It just started happening, and now i can't get music, movies, etc. on it. It always displays that same message, and now i'm

  • How to start with RMAN as I am beginner?

    Dear all, How to start with RMAN as I am beginner? Any simple document or guide line for me. Thanks, Amy

  • Safari will not open ftp sites!

    When I write ftp addresses in Safari it opens in Firefox! How can I make Safari the default ftpreader? It is already set as the default browser..

  • Won't let me sign in on iTunes even though I'm doing it right

    Itunes has been working succefully for 2 days, but today i tried to purchase a song and it said that my password was wrong but it wasnt my sn was correct there wasnt cap locks on and it was on AOL account and it won't let me go on forgot password it