String.indexOf don't find sign on correct position (bug or feature)

Hello list,
current I'm not sure that I understand java with internationalisation.
My code look like:
String east = "ě�čř�����Ě�ČŘ����";
System.out.println(east.indexOf("ě"));
System.out.println(east.indexOf("Ě"));
System.out.println(east.indexOf("�"));On output I get
0
0
10
The first and last is all right, but in the middle the values is not right.
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)
also with 1.5.0_04
on Win2000 (german)
regards Dietmar

Use Eclipse 3 :) (Yes, I did really mean Eclipse 3 because Eclipse 2 has bug that it can't handle Unicode correctly, but I don't think anybody would use Eclipse 2 nowadays, isn't it?) Of course, it'd better Eclipse 3.1.
Then in Eclipse, go to menu Windows > Preferences > General > Editors > Text File encoding = Others (UTF-8). In this way, every file is supposed to be UTF-8 unless specified otherwisely. Be aware that Eclipse doesn't write BOM to UTF-8 file, so I'd recommend you to put a comment like this at the beginning of every file:
// this file is saved in UTF-8
Personally, I do this to remind me which is which if ever I need to open file other than in Eclipse. In this way, it's a lot easier to read than \u0bad \ufeed \udeed \ubeef :D :D :D

Similar Messages

  • I don't find the correct download

    I have the creative suite design premium 5.5 education edition. I copy my mac in a new one and some programs don't work. I need to reinstall but I don't find the correct product to download from the website. My activation code fails in every download. I hope someone has some light for me. Thank you.

    If the download did not work for you then that might be your problem.  The download link is legitimate, so it might mean you need to adjust things at your end for the download to work.   Make sure you have cookies enabled and clear your cache.  If it continues to fail try using a different browser.  If you are using the wrong serial number that might be the reason.
    You can also download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS5.5: http://prodesigntools.com/adobe-cs5-5-direct-download-links.html

  • I don't find the mistake :(

    i simply don't find the mistake in that code. it's supposed to browse through a folder you specify and then print out all the files, folders (+ the files in there etc.) into a text file (txt or doc). the output in the eclipse console is correct, but the output to the file is not. if i want to write it to a file (txt or doc) it only browses/writes the top level files and folders. contents of subfolders are not witten into the file? so apparently the recursion doesn't work when i write into a file. but why is that?! below my code...
    void browseFolder(String s){
              File destination = new File(s);
              String entries[] = destination.list();
              int i=0;
              try{
                   File textfile = new File(s+"/file.doc");
                   FileWriter writefile = new FileWriter(textfile);
                   BufferedWriter textbuffer = new BufferedWriter(writefile);
                   if (destination.isDirectory()){     
                        while (i<entries.length){
                             File destinationUnterfile = new File(s+"/"+entries);
                             if (destinationUnterfile.isDirectory()){
                                  //to file
                                  textbuffer.write(s+"/"+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.write("--------------------------------------");
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println(" ");
                                  System.out.println(" ");
                                  System.out.println(s+"/"+entries[i]);
                                  System.out.println("--------------------------------------");
                                  browseFolder(s+"/"+entries[i]);
                             }else{
                                  //to file
                                  textbuffer.write("- "+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println("- "+entries[i]);
                             }//end if/else
                             i++;
                        }//end while
                        textbuffer.close();
                   }else{
                        System.out.println("Please specify a folder to browse.");
                   }//end if/else
              }//end try
              catch (IOException e){
                   System.out.println("Error -- " + e.toString());
              }//end catch
         }//end browseFolder

    hm, does it work if i insert a timestamp into the filename? if tried it like that, but it still doesn't work!
    void browseFolder(String s){
              File destination = new File(s);
              String entries[] = destination.list();
              int i=0;
              try{
                   Date dt = new Date();
                   File textfile = new File(s+"\\file"+dt.getTime()+".doc");
                   System.out.println(s+"\\file"+dt.getTime()+".doc");
                   FileWriter writefile = new FileWriter(textfile);
                   BufferedWriter textbuffer = new BufferedWriter(writefile);
                   if (destination.isDirectory()){     
                        while (i<entries.length){
                             //File destinationUnterfile = s+entries;
                             File destinationUnterfile = new File(s+"\\"+entries[i]);
                             if (destinationUnterfile.isDirectory()){
                                  //to file
                                  textbuffer.write(s+"\\"+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.write("--------------------------------------");
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println(" ");
                                  System.out.println(" ");
                                  System.out.println(s+"\\"+entries[i]);
                                  System.out.println("--------------------------------------");
                                  System.out.println(s+"\\"+entries[i]);
                                  browseFolder(s+"\\"+entries[i]);
                             }else{
                                  //to file
                                  textbuffer.write("- "+entries[i]);
                                  textbuffer.newLine();
                                  textbuffer.newLine();
                                  //to console
                                  System.out.println("- "+entries[i]);
                             }//end if/else
                             i++;
                        }//end while
                        textbuffer.close();
                   }else{
                        System.out.println("Please specify a folder to browse.");
                   }//end if/else
              }//end try
              catch (IOException e){
                   System.out.println("Error -- " + e.toString());
              }//end catch
         }//end browseFolder

  • Read text from file, created string, but don't know how to split string.

    I've been busy with a little application which should be able to save a (2d) array to a text file, and open it afterwards.
    I already completed both steps, but i'm stuck at the reading part.
    I'm not familiar with the load function, so i used Datainputstream, which i've converted to a String afterwards. The systemconsole shows the correct information when I put the string to the console, but now i want to split the string.
    For example, my console writes:
    FILE CONTENT=458,304,0,345,432
    ("FILE CONTENT=" has been manually added to the system.out)
    Because im not English, and i don't know what I should search for on the web in order to find this, i've come up here and created this post.
    I've got an object array which is 2-dimensional, and now i was wondering how i could "rebuild" my array array[x][c] in which the first number of my file content should be X and the other numbers should be put in [c].
    Offcourse, the ',' should be skipped.
    I do have read things about tokenizing and so on, but i think that every single letter is read then.
    Any help would be much appreciated.

    Ok, thanks for the reply.
    I feel a bit ashamed now, because my topic title contains the function i needed...
    So, assuming that i would have
    String content = "458,304,0,345,432";i could split this and put this in an array string using a code like
    String[] arry = null;
    array = content.split("\\.");I haven't tested the code yet, cause i'll go to bed soon, but will this split all at once and put it in the array or do i have to create a loop or something ?
    And is it possible to put number one using split in the array[x][v] on the x location and the others at the [v] location ? (the first number of each five has to be added to [x] and the other 4 to [v] )
    Again thanks for your reply, cause im a bit further this way in accomplishing what i want to reach :)

  • The download function is not working....!! When I click on something like download a doc,pdf or any such file, the firefox just doesn't respond, and when I checked the download, i.e. cntrl+j, I don't find anything in the downloads...

    The download function is not working....!! I don't use any add-ons like idm or dap,etc.... When I click on something like download a doc,pdf or any such file, the firefox just doesn't respond, and when I checked the download, i.e. cntrl+j, I don't find anything in the downloads... I am currently using Firefox 7.0.1....... Nothing is being downloaded, and I am forced to use IE8 for everything... I even tried re-installing, but doesn't help... I am using Windows 7

    TonyE is correct the plugin version comes with Adobe's Reader X.
    The failure in communication is two parted:
    1. Reader X is not Acrobat (Mozilla Plugin Checker)
    2. Acrobat is not mentioned in the Reader X download Page (Adobe)
    therefore confused clients.
    For readers '''CAUTION''' check the minimum requirements for Reader X.
    Here: [http://www.adobe.com/products/reader/tech-specs.html Adobe's Reader X requirements link]
    Do not waste the time to download (80+MB and Site is Slow) if your machine does not have the resources to execute it. ie. '''aging''' Hardware
    Unfortunately the Adobe DLM only checks the requirements after it has
    downloaded BEFORE the install occurs.
    This is '''very expensive''' for both the sender and receiver
    It might be why they called it READER X and READER 9 will not sense an update...
    Another Software company pushing Hardware antiquity...

  • Finder is not correctly reporting available disk space

    finder is not correctly reporting available disk space
    my drive is 50% full but finder shows there is only @ 35% left
    the difference is more than anything needed by the system
    any ideas on what is causing the problem?

    Try this:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger, and 4.1 for Leopard) and/or TechTool Pro (4.6.1 for Leopard) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.

  • Need to disable privacy browsing in Safari according to yahoo but don't find the option. New to this.

    Need to disable privacy browser in Safari to access mail but don't find it there. New to iPad!

    On the Safari page tap the + sign in the upper right then private in the lower left. You know private is on when the top of the Safari page is dark with white letters.

  • HT4767 i have a mac os x version 10.7.2 . but i don't find Xcode for 10.7.2 . can you help me!!!

    hello
    i have a mac os x 10.7.2 . but i don't find xcode for 10.7.2 . can you help me.

    IIRC = if I remember correctly.
    http://www.acronymfinder.com/IIRC.html

  • I don't find mistake in my program

    public class Automorphic
    int Number;
    int d=10;
    Automorphic(int n)
    number=n;
    int Decimals ()
    int d = 10;
    int n = number;
    while (d<=n);
    d=d*10;
    return d;
    boolean Automorfin ()
    if ((number*number) % d == number) return true;
    else return false;
    void Rezult ()
    if (Automorfin()) System.out.println("number is automorphic");
    else System.out.println("number isn't automorphic");
    public static void main (String[] args)
    Automorphic c = new Automorphic(Integer.parseInt(args[0])); // parseint perveda is string i integer, args[0] ivestas string tipo parametras(string tipo masyvas)
    c.Rezult();
    Program did't recognize automorphic numbers bigger than 1,5,6 (for example 25,36 is automorphic numbers but the program didn't recognize them)
    automorhic number is a number n whoes square ends in n.
    Message was edited by:
    InGike

    I think that mistake is that in this method "if
    ((skaicius*skaicius) % d == skaicius) return true;
    else return false;"
    the program takes d as 10, not from the previous method...
    but I don't know how to correct it...Have a look at your constructor I slightly modified:Automorphic(int n)
    number=n;
    d= Decimals();
    }btw, I still haven't read your code thoroughly and IMHO the initialization
    should be done a bit differently, but the suggestion above should solve
    some mistakes.
    kind regards,
    Jos

  • Foto don't find location of original file raw

    Hello,
    for error after i have traslate my library from aperture to Foto i have delete the aperture library.So after that the app foto don't find the original file location of any Foto. The file location of any foto is remain the same and before i delete the aperture library everything function correct.
    If i try to modificate any Foto the system want know the location of original file, but is very hard job if i have to show for any foto the location. there is some procedure for show at entire library the location?
    Thanks
    Fabrizio

    Hello,
    for error after i have traslate my library from aperture to Foto i have delete the aperture library.So after that the app foto don't find the original file location of any Foto. The file location of any foto is remain the same and before i delete the aperture library everything function correct.
    If i try to modificate any Foto the system want know the location of original file, but is very hard job if i have to show for any foto the location. there is some procedure for show at entire library the location?
    Thanks
    Fabrizio

  • Itunes don't find some files after close the application

    I have a local network. I have decided to share my music from a share server samba on Linux to my laptop on XP , my macbook , and my Imac.
    I have made this solution because have many problems to share the music on my Imac between users.
    The libary sharing music is not synchronise during the time. I explain : If i import a cd to Itunes on My imac, my wife don't have the music. ( security problems I thinck). ITunes is on Public and the acess is granted for users.
    I was admin Unix system
    I don' t wanted to copy the files on the Itmusic on each users.
    The other solution is the linux server samba sharing a directory Itunes_share. I have made a directory Itunes Music and put all the files mp3 and podcast.
    the share is good by selinux and the group is Itunes
    After that Itunes has recreated the share database. The system is right.
    But tomorrow, I has lost the songs on the interface. When I click on the song , I have a !
    The problem is the same on Windows XP
    After the migration for Iphone 2.0, song with ! apparears.
    Just yesterday, i have access Itunes with the user, and i can hear song with ! . The files have on disk but ITunes don't find after closing the aplication.
    Also , I has note that the lenght of the string is cast . And you have 2 files for the same files.
    Just the name is different. ie : the lenght is 14 caracters the other is 16 caracteres
    The problem is current
    I thinck that is a bug of Itunes

    I have unterstand the problems.
    You have two reason that itunes don't find the files.
    1) if the share is forward networking, the lost of share can be a good reason
    Itunes changed preference to the default localisation of your files in preference
    2) share the same files by two different libary of two computer or user differents
    I think that Itunes made a lock in the syntaxe

  • I just installed MS Office 2013 but I don't find where the programs are.

    I just installed MS Office 2013, when I try to access Excell or Word, I don't find them in my system.  In the past, as soon as you install MS Office, each program (Excel, Word, Power Point) shows in the desktop.
    This question was solved.
    View Solution.

    gavega
    Welcome to the HP Community Forum.
    You can try searching your Start Screen / Apps
    This might help:
    Search Start Screen for Installed Application
    Click the Kudos Thumbs-Up to say Thank You!
    And...Click Accept as Solution when my Answer provides a Fix or Workaround!
    I am pleased to provide assistance on behalf of HP. I do not work for HP. 
    Kind Regards,
    Dragon-Fur

  • I hope someone gets this who can help me. i don't find anything helpful in the help section of icloud. i'm using my 4th generation itouch for about 3 weeks with the ical. but today when i tried to edit an event or d an event a window would pop up and sa

    i hope someone gets this who can help me. i don't find anything helpful in the help section of icloud. i'm using my 4th generation itouch for about 3 weeks with the ical. but today when i tried to edit an event or add an event a window would pop up and say "event can't be saved" or "no calendar chosen" or something like "this event doesn't belong with this calendar" and stuff like that.
    can you please help me fix this?

    You could repartition your drive to have a different OS X with the older iTunes there, and the newer iTunes on the existing partition. Back up everything beforehand. See Kappy's advice in this thread. Partitioning my Hard Drive

  • How to find out the Correct Controlfile script Trace .trc file in /bdump

    Hi Guys
    This is the most childish queries in this forum ..
    I wanna know how to Find out the correct trace file when we Issue alter database backup controlfile to trace at sqlprompt for Creating controlfile script.
    As i find it a bit confusing to go through the same Date & almost same time .trc files out of hundreds of trace file in /bdump directory to find the correct one.
    if we 've to find the Alert log file in /bdump directory $ ls -l al* & we get the alert log file .... if there is any similar way to find out the controlfile script Trace file ?
    Thanks & regards
    MZ

    MZ_AppsDBA wrote:
    Hi Guys
    This is the most childish queries in this forum ..
    I wanna know how to Find out the correct trace file when we Issue alter database backup controlfile to trace at sqlprompt for Creating controlfile script.
    As i find it a bit confusing to go through the same Date & almost same time .trc files out of hundreds of trace file in /bdump directory to find the correct one.
    if we 've to find the Alert log file in /bdump directory $ ls -l al* & we get the alert log file .... if there is any similar way to find out the controlfile script Trace file ?
    Thanks & regards
    MZcreation of the does not happen automatically. What script, and when does it run, do you have that creates the control file trace? Look for files in that time frame. Better, modify that script to specifically name the file .. BACKUP CONTROLFILE TO TRACE AS ....

  • I'm trying to find the plugin for camera raw, but all I can find is the page with the cameras that are supported. But I don't find how to find and install the actual plugin. The end name is ARW

    I'm trying to find the plugin for camera raw, but all I can find is the page with the cameras that are supported. But I don't find how to find and install the actual plugin. The end name is ARW, and all I need is to find WHERE I can download it. Thanks.

    cr is installed by updating your app.  use help>update, or update manually
    pre cc updates:  http://www.adobe.com/downloads/updates/
    cc updates:  http://prodesigntools.com/adobe-cc-updates-direct-links-windows.html
    cc 2104 updates:  http://prodesigntools.com/adobe-cc-2014-updates-links-windows.html

Maybe you are looking for

  • The Photo Library needs to be upgraded....

    "The Photo Library needs to be upgraded to work with this version of iPhoto." This came up as I opened iPhoto 4.0.3. which I have been running since June 05. I don't think and I looked to see if iPhoto got updated, all looks the same. Please advise a

  • Use of iphone without roaming charges

    Hope someone can help, I'm off to New York soon and was wondering if there is an app, or good maps of New York and surrounding areas that can be used offline. Don't really want to arrive back in the UK with a huge phone bill waiting for me. Cheers

  • IPhoto always crashes when uploading to facebook

    Every time i start uploading a album to facebook it crashes after 5-10 min. Here is the errror log. can somebody take a look at it? thx! Process:         iPhoto [739] Path:            /Applications/iPhoto.app/Contents/MacOS/iPhoto Identifier:      co

  • Does anyone know how to get final cut pro 10.0.8 (downgraded from Mavericks)

    I have down graded from Mavericks as I don't have the 2k needed to upgrade all my other apps I need a copy of final cut pro 10.0.8, any ideas?

  • Audigy Driver issue on reb

    Hello I am trying to install an Audigy sound card on a Windows XP Pro pc the card installs fine and works until you reboot. After you reboot there is an error in device manager (Code 9) that says "Windows cannot start this hardware device because its