Cannot rename file with non-ASCII characters when using the

My application moves files from one directory to another by calling File[] srcFiles = srcDir.listFiles() to get a list of files in the source directory, and then calling srcFiles.renameTo(destFile) to rename each file.
This does not work (renameTo returns false and the file is not moved) under the following circumstances:
- the file's leaf name contains non-ASCII characters, for example "�"
- the OS is Solaris 9
- the LANG and LC_* environment variables are unset, i.e. the C locale is being used
If I set the LANG environment variable to, for example, en_GB.UTF-8 then the rename succeeds.
I have tried calling srcFiles[index].getName().getBytes("UTF-8") and the non-ASCII characters are being replaced with ? (0x3f) characters when LANG is unset.
Is this a bug in the JRE? I would argue that since my code does not actually manipulate the filename (I just use the File object that File.listFiles() gives me) then the rename should succeed. Of course I would not expect the file name to be displayed correctly if I printed it out.
I have reproduced this behaviour with JDK 1.4.2_05 and 1.5.0_04 on Solaris 9.
Francis

Thanks for the info Alan.
I considered setting the locale in the environment (this sounds like the "correct" fix to me and we might implement it later), but this application shares a WebLogic server with many other applications so we would have to do a huge amount of testing to make sure that the locale change wouldn't break the other apps. In the end I worked around the problem by making the code that generates the filenames in the first place strip out any non-ASCII characters (the names of the files are not critically important).
Looking forward to JSR-203, in the meantime perhaps a note about this behaviour in the java.io.File javadoc would be useful.

Similar Messages

  • Cannot create file with Non-latin characters- I/O

    I'm trying to create a file w/ Greek (or any other non-latin) characters ... for use in a RegEx demo.
    I can't seem to create the characters. I'm thinking I'm doing something wrong w/ IO.
    The code follows. Any insight would be appreciated. - Thanks
    import java.util.regex.*;
    import java.io.*;
    public class GreekChars{
         public static void main(String [ ] args ) throws Exception{
              int c;
              createInputFile();
    //          String input = new BufferedReader(new FileReader("GreekChars.txt")).readLine();
    //          System.out.println(input);
              FileReader fr = new FileReader("GreekChars.txt");
              while( (c = fr.read()) != -1)
                   System.out.println( (char)c  );
         public static void createInputFile() throws Exception {
              PrintStream ps = new PrintStream(new FileOutputStream("GreekChars.txt"));
              ps.println("\u03A9\u0398\u03A0\u03A3"); // omega,theta,pi,sigma
              System.out.println("\u03A9\u0398\u03A0\u03A3"); // omega,theta,pi,sigma
              ps.flush();
              ps.close();
              FileWriter fw = new FileWriter("GreekChars.txt");
              fw.write("\u03A9\u0398\u03A0\u03A3",0,4);
              fw.flush();
              fw.close();
    // using a printstream to create file ... and BufferedReader to read
    C:> java GreekChars
    // using a Filewriter to create files  .. and FileReader to read
    C:> java GreekChars
    */

    Construct your file writer using a unicode format. If
    you don't then the file is written using the platform
    "default" format -probably ascii.
    example:
    FileWriter fw = new FileWriter("GreekChars.txt",
    "UTF-8");I don't know what version of FileWriter you are using, but not that I know of take two string parameters. You should try checking the API before trying to help someone, instead of just making things up.
    To the OP:
    The proper way to produce a file in UTF-8 format would be this:
    OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream("filename"), "UTF-8");Then to read the file, you would use:
    InputStreamReader reader = new InputStreamReader(new FileInputStream("filename"), "UTF-8");

  • Filling clob with non ascii characters

    Hello,
    I have had some problems with clobs and usage of german
    umlauts (����). I was'nt able to insert or update
    strings containing umlaute in combination with string
    binding. After inserting or updating the umlaut
    characters were replaced by strange (spanish) '?'
    which were upside down.
    However, it was working when I did not use string bindung.
    I tried varios things, after some time I tracked
    the problem down to to oracle.toplink.queryframework.SQLCall.java. In the
    prepareStatement(...) you find something
    like
    ByteArrayInputStream inputStream = new ByteArrayInputStream(((String) parameter).getBytes());
    // Binding starts with a 1 not 0.
    statement.setAsciiStream(index + 1, inputStream,((String) parameter).getBytes().length);
    I replaced the usage of ByteArrayInputStram with CharArrayReader:
    // TH changed, 26.11.2003, Umlaut will not work with this.
    CharArrayReader reader = new CharArrayReader(((String) parameter).toCharArray());     
    statement.setCharacterStream(index + 1, reader, ((String) parameter).length() );
    and this worked.
    Is there any other way achieving this? Did anyone
    get clobs with non ascii characters to work?
    Regards -- Tobias
    (Toplink 9.0.3, Clob was mapped to String, Driver was Oracle OCI)

    I don't think the console font is the problem. I use Lat2-Terminus16 because I read the Beginner's Guide on the wiki while installing the system.
    My /etc/vconsole.conf:
    KEYMAP=de
    FONT=Lat2-Terminus16
    showconsolefont even shows me the characters missing in the file names; e.g.: Ö, Ä, Ü

  • Problems with non-ASCII characters on Linux Unit Test Import

    I found a problem with non-ASCII characters in the Unit Test Import for Linux.  This problem does not appear in the Unit Test Import for Windows.
    I have attached a Unit Test export called PROC1.XML  It tests a procedure that is included in another attachment called PROC1.txt. The unit test includes 2 implementations.  Both implementations pass non-ASCII characters to the procedure and return them unchanged.
    In Linux, the unit test import will change the non-ASCII characters in the XML file to xFFFD. If I copy/paste the the non-ASCII characters into the Unit Test after the import, they will be stored and executed correctly.
    Amazon Ubuntu 3.13.0-45-generic / lubuntu-core
    Oracle 11g Express Edition - AL32UTF8
    SQL*Developer 4.0.3.16 Build MAIN-16.84
    Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)
    In Windows, the unit test will import the non-ASCII characters unchanged from the XML file.
    Windows 7 Home Premium, Service Pack 1
    Oracle 11g Express Edition - AL32UTF8
    SQL*Developer 4.0.3.16 Build MAIN-16.84
    Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
    If SQL*Developer is coded the same between Windows and Linux, The JVM must be causing the problem.

    Set the System property "mail.mime.decodeparameters" to "true" to enable the RFC 2231 support.
    See the javadocs for the javax.mail.internet package for the list of properties.
    Yes, the FAQ entry should contain those details as well.

  • Difficulties retrieving documents with non ascii characters in name

    Hello
    I have a very simple container with only one document in it: *<ação nome="ação"/>*
    When using the dbxml shell to retrieve it, no problem:
    dbxml> open teste.dbxml
    dbxml> get "ação"
    1 documents found
    dbxml> print
    <?xml version="1.0" encoding="UTF-8"?>
    <ação nome="ação"/>
    (The strange characters appear because my terminal uses Latin1 encoding.)
    But I cannot retrieve the document with a very simple Java program (left out basic environment setup for clarity - I will put the full code in a follow-up post):
    String name = new String("ação"); +// will cause: com.sleepycat.dbxml.XmlException: Error: Document not found: ação, errcode = DOCUMENT_NOT_FOUND+
    // String name = new String("ação".getBytes(), utf8); +// will cause: com.sleepycat.dbxml.XmlException: Error: Document not found: ação, errcode = DOCUMENT_NOT_FOUND+
    String name = new String("ação".getBytes(), latin1); +// will cause: com.sleepycat.dbxml.XmlException: Error: Document not found: ação, errcode = DOCUMENT_NOT_FOUND+
    XmlDocument doc = container.getDocument(tx, name);
    Almost certainly this problem has to do something with the encoding of the name, but I cannot see why.
    Thank you very much for looking into this,
    Greetings,
    Koen

    As promised, the full Java code of this basic program:
    package info.carrapateira;
    import com.sleepycat.dbxml.*;
    import com.sleepycat.db.*;
    import java.io.*;
    import java.nio.charset.*;
    public class DbxmlTest2 {
         static Charset utf8 = Charset.forName("UTF-8");
         static Charset latin1 = Charset.forName("ISO-8859-1");
         public static void main(String[] args) {
              EnvironmentConfig envCfg = new EnvironmentConfig();
              envCfg.setAllowCreate(true);
              envCfg.setInitializeCache(true);
              envCfg.setInitializeLocking(true);
              envCfg.setInitializeLogging(true);
              envCfg.setRunRecovery(true);
              envCfg.setTransactional(true);
              Environment env = null;
              XmlManager manager = null;
              XmlContainer container = null;
              XmlTransaction tx = null;
              try {
                   env = new Environment(new File(args[0]), envCfg);
                   XmlManagerConfig cfg = new XmlManagerConfig();
                   cfg.setAdoptEnvironment(true);
                   manager = new XmlManager(env, cfg);
                   XmlContainerConfig ctCfg = new XmlContainerConfig();
                   ctCfg.setTransactional(true);
                   container = manager.openContainer("teste.dbxml", ctCfg);
                   tx = manager.createTransaction();
                   String name = new String("ação"); // com.sleepycat.dbxml.XmlException: Error: Document not found: ação, errcode = DOCUMENT_NOT_FOUND
                   // String name = new String("ação".getBytes(), utf8); // com.sleepycat.dbxml.XmlException: Error: Document not found: ação, errcode = DOCUMENT_NOT_FOUND
                   //String name = new String("ação".getBytes(), latin1); // com.sleepycat.dbxml.XmlException: Error: Document not found: ação, errcode = DOCUMENT_NOT_FOUND
                   XmlDocument doc = container.getDocument(tx, name);
                   tx.commit();
              } catch (Exception e) {
                   e.printStackTrace();
                   try {
                        tx.abort();
                   } catch (Exception e1) {
                        e1.printStackTrace();
              } finally {
                   try {
                        container.close();
                        manager.close();
                   } catch (Exception e) {
                        e.printStackTrace();
    }

  • Problem with non-ASCII characters on TTY

    Although I'm not a native speaker, I want my system language to be English (US), since that's what I'm used to. However I have a lot of files which have German language in their file names.
    My /etc/locale.conf has en_US.UTF-8 and de_DE.UTF-8 enabled. My /etc/locale.conf contains only the line
    LANG=en_US.UTF-8
    The German file names show up fine within Dolphin and Konsole (ls -a). But they look weird on either of the TTYs (the "console" you get to by pressing e.g. ctrl+alt+F1). They have other characters like '>>' or the paragraph symbol where non-ASCII characters should be. Is it possible to fix this?

    I don't think the console font is the problem. I use Lat2-Terminus16 because I read the Beginner's Guide on the wiki while installing the system.
    My /etc/vconsole.conf:
    KEYMAP=de
    FONT=Lat2-Terminus16
    showconsolefont even shows me the characters missing in the file names; e.g.: Ö, Ä, Ü

  • Can't get the attachment filename out of a Part (with non ascii characters)

    Hello, all and happy new year :)
    My issue is with non ascii filename in attachments... Yes i've read the FAQ : http://www.oracle.com/technetwork/java/faq-135477.html#encodefilename
    I can't get the filename out of the BodyPart for those kind of attachments
    here's my unit test :
         * contains various parts from various mailer encoded in different ways...
         private enum EncodedFileNamePart{
              OUTLOOK("Content-Type: text/plain;\n name=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \n\nnoel 2010\n","c'estdéjànoëlçac'estcool.txt"),
              GMAIL("Content-Type: text/plain; charset=US-ASCII; name=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Disposition: attachment; filename=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Transfer-Encoding: base64\nX-Attachment-Id: f_giityr5r0\n\namluZ2xlIGJlbGxzIQo=\n","déjànoëlçacestcool.txt"),
              THUNDERBIRD("Content-Type: text/plain;\n name=\"=?ISO-8859-1?Q?d=E9j=E0no=EBl=E7acestcool=2Etxt?=\"\nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename*0*=ISO-8859-1''%64%E9%6A%E0%6E%6F%EB%6C%E7%61%63%65%73%74%63%6F;\n filename*1*=%6F%6C%2E%74%78%74\n\njingle bells!\n","déjànoëlçacestcool.txt"),
              EVOLUTION("Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt\nContent-Type: text/plain; name*=ISO-8859-1''d%E9j%E0no%EBl.txt; charset=\"UTF-8\" \nContent-Transfer-Encoding: 7bit\n\njingle bells\n","déjànoël.txt"),
              String content=null;
              String target=null;
              private EncodedFileNamePart(String content,String target){
                   this.content=content;
                   this.target=target;
              public Part get(){
                   try{
                   ByteArrayInputStream bis = new ByteArrayInputStream(this.content.getBytes());
                   Part part = new MimeBodyPart(bis);
                   bis.close();
                   return part;
                   catch(Throwable e){
                        return null;
              public String getTarget(){
                   return this.target;
         @Test
         public void testJavamailDecode() throws MessagingException, UnsupportedEncodingException{
              System.setProperty("mail.mime.encodefilename", "true");
              System.setProperty("mail.mime.decodefilename", "true");
              for(EncodedFileNamePart part : EncodedFileNamePart.values())
                   assertEquals(part.name(),MimeUtility.decodeText(part.get().getFileName()),part.getTarget());     
    I take a NullPointerExcepion in the decodeText because getFileName() return null for the EVOLUTION case, and work well with OUTLOOK, THUNDERBIRD and GMAIL.
    Evolution's content type is "Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt" wich doesn't look like the other (looks like the RFC 2616 or RFC5987 to do it.)
    How can i handle this situation except by writting my own decoder?
    Thanks for your answers!
    Edited by: user13619058 on 4 janv. 2011 07:44

    Set the System property "mail.mime.decodeparameters" to "true" to enable the RFC 2231 support.
    See the javadocs for the javax.mail.internet package for the list of properties.
    Yes, the FAQ entry should contain those details as well.

  • Upload text files with non-english characters

    I use an Apex page to upload text files. Then i retrieve the contents of files from wwv_flow_files.blob_content and convert them to varchar2 with utl_raw.cast_to_varchar2, but characters like ò, à, ù become garbage.
    What could be the problem? Are characters lost when files are stored in wwv_flow_files or when i do the conversion?
    Some other info:
    * I see wwv_flow_files.DAD_CHARSET is set to "ascii", wwv_flow_files.FILE_CHARSET is null.
    * Trying utl_raw.cast_to_varchar2( utl_raw.cast_to_raw('àòèù') ) returns 'àòèù' correctly;
    * NLS_CHARACTERSET parameter is AL32UTF8 (not just english ASCII)

    Hi
    Have a look at csv upload -- suggestion needed with non-English character in csv file it might help you.
    Thanks,
    Manish

  • Unable to play videos with non-ASCII-characters in filename

    Hi!
    I use a MediaPlayer to display MP4-videos in my application. This works quite well. Unfortunately I have a problem if the filename of the video to be shown contains non-ASCII-charcaters.
    I get the following message:
    -->file:D:\daten\avi\��� ����.MPG
    Error: Unable to realize com.sun.media.amovie.AMController@4b7651
    Failed to realizeThe first line shows the filename I pass to the setMediaLocation()-method of the MediaPlayer-object.
    What's wrong? If I rename the file to ABC.mpg it works fine.
    Thanks for your help
    Thomas

    Hi!
    I use a MediaPlayer to display MP4-videos in my application. This works quite well. Unfortunately I have a problem if the filename of the video to be shown contains non-ASCII-charcaters.
    I get the following message:
    -->file:D:\daten\avi\��� ����.MPG
    Error: Unable to realize com.sun.media.amovie.AMController@4b7651
    Failed to realizeThe first line shows the filename I pass to the setMediaLocation()-method of the MediaPlayer-object.
    What's wrong? If I rename the file to ABC.mpg it works fine.
    Thanks for your help
    Thomas

  • Naming files with non English characters.

    I'm using filemaker to creat PDF's through Acrobat 10.1.12. I need to use Polish, Hungarian, Czech and Slovakian characters in the file name but the characters are not recognised and so the file name will not create. This is for Windows, the problem does not occur on a mac.

    Hi
    Have a look at csv upload -- suggestion needed with non-English character in csv file it might help you.
    Thanks,
    Manish

  • Cp and tar files with non printable characters

    Hi all,
    Maybe it's a silly question but just got stuck with this.
    We have an XSan with diverse material from varios departaments. Besides having a backup on tape I was trying to just do a plain copy from a terminal of all the files to another disk just using cp or tar.
    But whenever cp or tar encounters a file with a nonprintable char they don't copy it.
    Let's say in the client Finder the named the file "opción.txt"
    The file shows up in terminal with an ? but cp or tar won't get the file.
    any clues?
    thanks!

    Hi
    Have a look at csv upload -- suggestion needed with non-English character in csv file it might help you.
    Thanks,
    Manish

  • Publishing pages with non-ASCII characters to folder

    There is a weirdness/anachronism in exported file names from iWeb'08.
    I have a page "Mökin katto" (that is Finnish).
    "ls" in Terminal shows the exported folder ok, like
    Mökin_katto.html
    Mökinkattofiles/
    Tarring and uploading to show on my Apache web server did not work so good, though. I changed the server to operate in UTF-8 locale and also use UTF-8 as the default character set. Still no success. At this point, I wanted to check the exported folder in the source (my MacBook). Tab completion didn't work:
    % Mö<TAB>
    didn't give any results. At this point, I wrote a simple Python script to dump the filenames. I created pages with different Scandinavian characters and capitalizations to demonstrate (I have cleaned the output a bit to remove unnecessary filenames):
    % ls
    MäkiÄn_katto.html MökiÖn_katto.html feed.xml
    MäkiÄnkattofiles/ MökiÖnkattofiles/ index.html
    MåkiÅn_katto.html Mökin_katto.html
    MåkiÅnkattofiles/ Mökinkattofiles/
    % ~/repos/scripts/misc/dirdump.py
    MäkiÄn_katto.html 'M(4d)' 'a(61)' cc88 'k(6b)' 'i(69)' 'A(41)'cc 88 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '.(2e)' 'h(68)' 't(74)' 'm(6d)' 'l(6c)'
    MäkiÄnkattofiles 'M(4d)' 'a(61)' cc88 'k(6b)' 'i(69)' 'A(41)'cc 88 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '_(5f)' 'f(66)' 'i(69)' 'l(6c)' 'e(65)' 's(73)'
    MåkiÅn_katto.html 'M(4d)' 'a(61)' cc8a 'k(6b)' 'i(69)' 'A(41)'cc 8a 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '.(2e)' 'h(68)' 't(74)' 'm(6d)' 'l(6c)'
    MåkiÅnkattofiles 'M(4d)' 'a(61)' cc8a 'k(6b)' 'i(69)' 'A(41)'cc 8a 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '_(5f)' 'f(66)' 'i(69)' 'l(6c)' 'e(65)' 's(73)'
    Media 'M(4d)' 'e(65)' 'd(64)' 'i(69)' 'a(61)'
    Mökin_katto.html 'M(4d)' 'o(6f)' cc88 'k(6b)' 'i(69)' 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '.(2e)' 'h(68)' 't(74)' 'm(6d)' 'l(6c)'
    Mökinkattofiles 'M(4d)' 'o(6f)' cc88 'k(6b)' 'i(69)' 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '_(5f)' 'f(66)' 'i(69)' 'l(6c)' 'e(65)' 's(73)'
    MökiÖn_katto.html 'M(4d)' 'o(6f)' cc88 'k(6b)' 'i(69)' 'O(4f)'cc 88 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '.(2e)' 'h(68)' 't(74)' 'm(6d)' 'l(6c)'
    MökiÖnkattofiles 'M(4d)' 'o(6f)' cc88 'k(6b)' 'i(69)' 'O(4f)'cc 88 'n(6e)' '_(5f)' 'k(6b)' 'a(61)' 't(74)' 't(74)' 'o(6f)' '_(5f)' 'f(66)' 'i(69)' 'l(6c)' 'e(65)' 's(73)'
    Scripts 'S(53)' 'c(63)' 'r(72)' 'i(69)' 'p(70)' 't(74)' 's(73)'
    Apparently Ö and ö are translated to the sequences '"O" 0xcc 0x88' and '"o" 0xcc 0x88', Ä and ä to '"A" 0xcc 0x88' and '"a" 0xcc 0x88' and finally Å and å to the sequences '"A" 0xcc 0x8a' and '"a" 0xcc 0x8a'. Looking into this a bit more, those ("0xcc 0x88" and "0xcc 0x8a") are the UTF-8 encodings of COMBINING DIAERESIS (U+308) (http://www.fileformat.info/info/unicode/char/0308/index.htm) and COMBINING RING ABOVE (U+030A) (http://www.fileformat.info/info/unicode/char/030a/index.htm).
    The generated links in the pages are in the short (Latin1 equivalent) form, but the filenames are in this format. The meaning of the strings is the same, but e.g. Apache doesn't internally canonicalize the paths, which results in broken URLs. I think iWeb should export the filenames and the URLs in identical UTF-8 strings (which quite likely should be the Latin1-equivalent Unicode code points). Especially as e.g. Terminal and bash only work with the short forms.
    Is there an option to make iWeb behave this way?

    I tried checking whether changing my keyboard layout (I've created the current one with Ukelele) to one which wrote decomposed characters changed things; it didn't. The filenames and generated html-files contained identical entries; I could use tab-completion for the generated filenames, though. (Bash was otherwise a bit confused about the change, so I can't recommend this)
    By canonicalizing the filenames with a script on the server (a Debian GNU/Linux system) end I can now make it work; the root cause of the discrefence between the file name and the URLs in the generated HTML is still a mystery. This would've worked if iWeb wrote decomposed UTF-8 characters to the URLs, also.

  • [Solved]Amarok don't play files with non latin1 characters in filename

    I know that this problem is not in amarok, i patched phonon from aur http://aur.archlinux.org/packages.php?ID=27465
    /src/import/gstreamer/mediaobject.cpp
    at line 365 in bool MediaObject::createPipefromURL(const QUrl &url)
    QByteArray encoded_cstr_url = url.toEncoded();
    m_datasource = gst_element_make_from_uri(GST_URI_SRC, encoded_cstr_url.constData(), (const char*)NULL);
    //for utf8 locale replace toLocal8Bit to toAscii
    //toLocalFile fails for files with "?" in filenames. toLocalFile("a?c.s") => "a"
    + if ( url.toString().indexOf("file://") == 0 )
    + g_object_set(m_datasource, "location", url.toString().replace(0,7,"").toLocal8Bit().constData(), NULL);
    if (!m_datasource)
    return false;
    and now amarok plays ALL files
    Last edited by klama (2009-08-03 12:23:16)

    which phonon backend are you using? try with a different one

  • How to support non alphanumeric characters when using WORLD_LEXER?

    BASIC_LEXER has an attribute of printjoins which we can specify the non alphanumberic characters as normal alphanumberic in query and included with the token. However, WORLD_LEXER doesn't have this attribute. So in order to use some non alphanumberic characters and treat them as alphanumberic characters in Oracle Text Index, such as ><$, what should I can?
    Thanks in advance for any help.

    I use WORLD_LEXER to create Oracle Text Index to support UTF-8.
    Below is the script to create table and index:
    REM Create table
    CREATE TABLE my_test
    ( id VARCHAR2(32 BYTE) NOT NULL,
    code VARCHAR2(100 BYTE) NOT NULL,
         CONSTRAINT "my_test_pk" PRIMARY KEY ("id"));
    REM create index
    exec ctx_ddl.create_preference('stars_lexer','WORLD_LEXER');
    exec ctx_ddl.create_preference('stars_wordlist', 'BASIC_WORDLIST');
    exec ctx_ddl.set_attribute('stars_wordlist','substring_index','TRUE');
    exec ctx_ddl.set_attribute('stars_wordlist','PREFIX_INDEX','TRUE');
    -- create index for Table corrosion level
    CREATE INDEX my_test_index
    ON my_test(code)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS ('LEXER stars_lexer STOPLIST stars_stop WORDLIST stars_wordlist SYNC(EVERY "SYSDATE+5/1440") TRANSACTIONAL');
    INSERT INTO my_test('1', 'English word1');
    INSERT INTO my_test('2', '违违');
    INSERT INTO my_test('3', '违违&^|违违');
    When I query:
    select * from corrosion_levels r where contains(r.CORROSION_LEVEL, '{%违${|违%}') > 0
    ID CODE
    3 违违$(|违违
    2 违违
    Actually, the result what I want is: 3 违违$(|违违
    So the requirement is that all non-alphanumeric characters should be treated as normal alphanumeric charcters. Please tell me how to implement it.

  • Is anybody else struggling with an intermittent connection when using the Magic Mouse/Trackpad ONLY on Boot Camp?

    Hi,
    I've seen thousands of posts about Bluetooth connection issues and interference and stutter/lag for both the Magic Mouse and Trackpad (affecting both Mac OS X and Windows under Boot Camp) but my problem is different.
    To summarise my setup, I use:
    - Retina MacBook Pro (lid closed or open, doesn't make a difference to this problem)
    - Thunderbolt Display
    - Wireless Keyboard
    - Magic Trackpad (have also tried a Magic Mouse and experience similar issues to the Trackpad)
    And in Mac OS X, everything works perfectly. The keyboard and trackpad work smoothly when I'm 6-7 metres from the machine, whether or not the laptop lid is open or closed, and whether or not the Thunderbold Display is connected.
    But on to my problem: the bluetooth connection is incredibly unreliable/intermittent when in Windows (I run Windows 7 64-bit and Boot Camp 4.0, and got both devices connected without any trouble via Bluetooth).
    But during usage, the cursor stutters/lags frequently, and tap to click (when enabled) seems to get triggered by mistake all the time (even when I'm not touching the Trackpad or even at the computer, clicks get registered).
    The Wireless Keyboard is perfect, and works well 5 metres from the machine. The Mouse and Trackpad, though, don't even work reliably when they are 6 inches from the machine. The built-in trackpad on the laptop works perfectly too, in Windows and Mac.
    I spent a week assuming I was suffering from Bluetooth interference, so I tried:
    - using the laptop with the lid open
    - removing the Thunderbolt display completely and trying the Magic Trackpad
    - repositioning items on my desk
    - disabling wifi
    All of these adjustments made minor differences to how good/bad the Trackpad was, but none came close to fixing the problem or making it work as smoothly as under Mac OS X. It was only after doing all of this that I realised perhaps it was just a Apple driver for Windows issue, so I booted into Mac OS X and tested everything out, and sure enough, it's all perfect. But back into Windows, the Trackpad doesn't work reliably at all.
    Obviously, the hardware is not at fault, and I assume the signal strength doesn't vary between operating system (why would it?) so I'm left believing this must be a driver issue. The TrackPad and Magic Mouse drivers have been out for a couple of years, so I'm surprised they can still be this bad. I tried both the latest driver from Boot Camp 4.0 (3.2.0.0) for the Trackpad, and also the older one from Boot Camp 3.2 (3.1.0.7) and both are equally bad for me.
    So my question is: has anybody else struggled with using the Trackpad (or Magic Mouse) with Boot Camp 4.0 and Windows 7 64-bit, whilst finding it to be perfect under Mac OS? I haven't found many posts complaining about the Windows driver, which is why I assumed it was an interference issue. But I'm almost sure it isn't, having spent 2 weeks investigating.
    Any thoughts/suggestions/answers much appreciated!
    Kyle

    SOLVED!
    After much testing, I have found the cause of lagging/jumpiness on the Bluetooth Magic Mouse and Magic TrackPad in Boot Camp. Hopefully this will help others:
    The drivers for the Broadcom 802.11n Wireless Adapter have a setting called "Bluetooth Collaboration" that is Disabled by default. Enabling this option removes the problem instantly. My Magic Trackpad now works flawlessly, even if I stand 6 metres from the machine. It now works just as well as under Mac OS. The setting can be found under:
    Control Panel > Device Manager > Network Adapters > Broadcom 802.11n Network Adapter (right click and choose "Properties". Under the "Advanced" tab, highlight the setting named "Bluetooth Collaboration", then change it to Enable. Then click OK.
    I narrowed the problem down to the wireless card by disabling ALL startup services and processes for Windows, then re-enabling one by one. As soon as I enabled the Windows Wireless Service, the problem came back. Similarly, disabling the Wireless Card inside the Network and Sharing Center (or Device Manager) removes the problem. This led me to believe it must be a driver issue with the wireless card, since the problem didn't occur with the Magic TrackPad under Mac OS, or on my mother's Windows 7 64-bit computer. So when I went into the Driver Properties to check for an update, I found this setting about Bluetooth Collaboration.
    I really hope this helps others trying to use Bluetooth devices under Boot Camp. All Apple notebooks use the Broadcom card (and have done for years), so this driver is installed for almost anybody using Boot Camp on an Apple notebook. I'd assume this problem would affect anybody using Boot Camp + wifi + a Bluetooth device.
    Cheers

Maybe you are looking for