Public int indexOf(int ch, int fromIdx) doesn't work for some decimal value

I have tested two strings below. These two string are identical, except the first string has a char 'ƒ, which has a decimal value of 131. And the second string has a char 'À', which has a decimal value of 192. I am expecting the same output, which is 11, but I got -1 for the test I did using the first string. In the API for public int indexOf(int ch, int fromIndex), values of ch is in the range from 0 to 0xFFFF (inclusive). It is highly appreciated if anyone could provide any insights on why -1 returned when the first string is tested. Thank you in advance.
String strHasDecimal131 = "Test value ƒ, it has a decimal value of 131";
String strHasDecimal192 = "Test value À, it has a decimal value of 192";
int badDecimal = 131;
int idxBadDecimal = strHasDecimal131.indexOf( badDecimal, 0);
System.out.println( "index of Bad Decimal: " + idxBadDecimal );
The output is: index of Bad Decimal -1
int badDecimal = 192;
int idxBadDecimal = strHasDecimal192.indexOf( badDecimal, 0);
System.out.println( "index of Bad Decimal: " + idxBadDecimal );
The output is: index of Bad Decimal: 11

Thank you everyone for your inputs. Following are the print statements and the output: for character 'ƒ' and ' À':
System.out.println((int)'\u0083' + ", " + (int)'\u00C0' + " print decimal value" );
Output: 131, 192 print decimal value
System.out.println((char)'\u0083' + ", " + (char)'\u00C0' + " print character value" );
Output: ?, À print character value
According to Latin-1 Supplement table, the first char in the output would have the appearance of ƒ, instead it has the appearance of ?
System.out.println( (int)'ƒ' + ", "+ (int)'À' + " print integer value");
Output: 402, 192 print integer value
I also have tried to print out the decimal value of following char: € � ‚ ƒ „ … † ‡, according to Latin-1 Supplement table, these char has decimal value of 128 through 135 and hex value 0x0080 through 0x0087. And the output from java println is: 8364 65533 8218 8222 8230 402 8224 8225.
System.out.println((int)'€' + " " + (int)'�' + " " + (int)'‚' + " " +(int)'„' + " " + (int)'…' + " " +(int)'ƒ' + " " + (int)'†' + " " + (int)'‡' );
As I did before, I print out character of decimal value of 128 through 135
System.out.println((char)128 + " " + (char)129 + " " + (char)130 + " " +(char)131 + " " + (char)132 + " " +(char)133 + " " + (char)134 + " " + (char)135 );
Output: ? ? ? ? ? ? ? ?
Not sure why java prints character for decimal value of 128 through 159 differently from what appears in the Latin-1 Supplement table. Any of your inputs are appreciately.

Similar Messages

  • My FaceTime doesn't work for some reason, and i want to know why. ;\  It's iOS 6.1.6

    My FaceTime doesn't work for some reason, and i want to know why. >;\  It's iOS 6.1.6

    Judging by all the posts on the forum, there seems to be an issue at Apple's end, although they have made no announcement on their status page. Some users have reported that Apple is aware of the issue.
    http://www.apple.com/support/systemstatus/

  • How do you save data into an excel file while myRIO is acquiring data? I tried saving it using "Write to file" but it doesn't work for some reason.

    I am acquiring cosine wave and a pulse wave as input and I want to store their peak to peak values into an excel file. "Write to File" is not working for it. Is there any other vi which can be used for data logging?
    Thank you for your help.

    Hi Ssheoran,
    Can you provide more detail when you say that the Write to File VI doesn't work? Is there an error given? Or can you just not find the file on your computer? Keep in mind using this file in a Real-Time VI on the myRIO will save files on the myRIO. You will then have to transfer to your PC. Please view the following video as a guide for saving files and transferring them to your computer: (http://www.youtube.com/watch?v=BuREWnD6Eno). Hope this helps.
    Best Regards,
    Roel F.
    Applications Engineer
    National Instruments

  • The back button doesn't work for some websites after downloading version 4.0

    I recently downloaded firefox version 4.0. Upon downloading it I had a few issues occur with my browser. One issue was that all of my bookmarks that were on my toolbar disappeared. Also, when I visit a website and am browsing through it, if I want to go back to a previous page the back button doesn't work properly. Instead of sending me back to the previous page I was viewing it sends me all the way back to the home page or wherever I started on that website. This problem basically affects all websites that I visit. I would like to uninstall the new version of firefox and just go back to my old one if that's possible? Thanks

    To respond to your comments first of all, the Bookmarks toolbar has been removed in Firefox 4.0
    The back button should work as it normally does, but you can also right click it and select it from the list.
    To revert to a previous version of Firefox, download v3.6.16 from here: [http://www.mozilla.com/en-US/firefox/all-older.html Download Firefox v3.6.16]
    Then uninstall Mozilla Firefox 4.0 choosing to keep your bookmarks, customizations etc.
    Finally run the Firefox installation file you downloaded earlier.

  • Audio Out doesn't work for some devices under 9600m GT; works under 9400m

    Hello. I've recently noticed that when I plug my MBP into my TV to use as a monitor and for speakers, I can't use the TV's audio when I'm using the 9600m GT for graphics, but, mysteriously, it works just fine when I'm on the 9400m. This is a major problem for when I want to play games.
    For some odd reason, though, plugging in headphones works perfectly under both configurations. I connect the audio to the TV using a standard audio cable that splits into the red and white plugs. Any idea how I can get audio up and running under the 9600m GT?
    Message was edited by: Pickleman

    Thanks for the confirmation.
    I think my issue could be the same, as i'm also trying to send audio to the tv via the headphone port. Just saying again to explain better:
    - Tv's have analog audio input for hdmi, but at least for mine, it only uses these inputs if it does (or doesn't) get a certain signal for audio over the hdmi connection.
    - Whatever the 9400 is doing, its convincing the tv to use the analog inputs, all is well.
    - Whatever the 9600 is doing, its convincing the tv -not- to use the analog inputs, thus no sound.
    It was a bit fiddly, but i got it to a state where audio through the headphone port would work fine under the 9400, i would set graphics to high performance, log out, log back in again, and audio would not work. Undoing this (setting the graphics to better battery life and relogging in) would restore sound.
    I'm thinking the root of the issue is that the tv gets detected as supporting audio, and something the 9600 is doing is fooling the tv to think it is receiving audio, though as you suggested it's not supported and nothing is going though.. which has the side effect of igoring the analog inputs we're sending though the headphone jack.
    Some sort of fix to disable audio down the displayport would be great. PC nvidia drivers that i'm running on the same mac in boot camp have an explicit option to do this, so it shouldn't be too hard..
    Or any other work around..
    Thanks!!

  • I deleted injustice from my ipad, and I'm trying to reinstall it, but it doesn't for some reason. I have lots of memory left but it still doesn't work for some reason. Can you please help ?

    I tried reinstalling injustice on my ipad, but it doesn't work.

    Hi Somehunk,
    Welcome to the Support Communities!
    The first thing I would suggest is to quit the iTunes Store app and sign out of your iTunes Store account on your iPhone.
    Then restart / reset the device.
    When you sign back in, you should be able to re-initiate the download.
    The following articles will explain these steps in more detail:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/HT1311?viewlocale=en_US
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/HT2519
    Cheers,
    Judy

  • Country list dropdown search by first letter doesn't work for some countries in the list

    Hi,
    We have this issue with the country list search in Travel Request with the drop down list when user is trying to choose the country by entering the first letter say C for Canada (finds Canada in the list) it works for the countries from A to O  and  doesn't work from P to Z.
    It is NW7.31 portal
    What seems to be the problem ?

    Hi Denis
    Get them to take a look at this wiki page:
    http://wiki.scn.sap.com/wiki/x/2oQCFQ
    It lists the latest notes for your basis version and the notes are usually cumulative which means if you apply the latest notes, it will bring in the pre-requisites and earlier notes too.
    Hope it helps you Denis.
    Sally

  • Dropdown country list search by first letter doesn't work for some countries in the list

    Hi,
    We have this issue with the country list search in Travel Request with the drop down list when user is trying to choose the country by entering the first letter say C for Canada (finds Canada in the list) it works for the countries from A to O  and  doesn't work from P to Z.
    It is NW7.31 portal
    What seems to be the problem ?

    Hi Denis
    Get them to take a look at this wiki page:
    http://wiki.scn.sap.com/wiki/x/2oQCFQ
    It lists the latest notes for your basis version and the notes are usually cumulative which means if you apply the latest notes, it will bring in the pre-requisites and earlier notes too.
    Hope it helps you Denis.
    Sally

  • Search Region Source doesn't work for some searches

    I am updating a table, and I wanted to search our Apex app to see what reports are using the table. I typed in the table name and no results came back.
    I knew of one report that definitely uses that table, so I went to it, copied the table name from the query source, and tried the search again - Still no results.
    I tried a different table name, and got a whole bunch of hits.
    The table name that doesn't work is floor_suite_billing
    I even tried partials of that name, but I do not get the report that uses that table.
    Is there something I am missing?
    TIA
    John

    So, I created a test report using "select * from floor_suite_billing" and did a search. This new report came up in the results but the other one didn't.
    Then I tried searching for other keywords from the query but that report still does not show up..
    does anyone have a reliable way of searching Apex?
    Thanks!
    John

  • Resize image code doesn't work for some JPGs

    Hi. I'm using the below code to resize images and store them on the server. However, with some JPGs, the resize produces a reddish tint on the image. Any ideas what could be causing this? Here's the original image: http://www.unctv.org/tWxkBbq_10M6wKRRL/PNCWWD01.jpg and here's what it produces afterward: http://www.unctv.org/tWxkBbq_10M6wKRRL/PABDFC01__1289231445291.jpg
    Photoshop CS5 is used to produce the JPG input for this app. Thanks.
    public BufferedImage resizeVeryHigh(InputStream inputStream, File resizedFile) throws IOException {
      BufferedImage bufferedImage = null;
      try {
          Image newImage = ImageIO.read(inputStream);
          int newWidth = (int)this.targetWidth;
          ImageIcon imageIcon = new ImageIcon(newImage);
          Image image = imageIcon.getImage();
          Image resizedImage = null;
          int iWidth = image.getWidth(null);
          int iHeight = image.getHeight(null);
          // This code ensures that all the pixels in the image are loaded.
          Image temp = new ImageIcon(resizedImage).getImage();
          // Create the buffered image.
          bufferedImage = new BufferedImage(temp.getWidth(null), temp.getHeight(null), BufferedImage.TYPE_INT_RGB);
          // Copy image to buffered image.
          Graphics g = bufferedImage.createGraphics();
          // Clear background and paint the image.
          g.setColor(Color.white);
          g.fillRect(0, 0, temp.getWidth(null), temp.getHeight(null));
          g.drawImage(temp, 0, 0, null);
          g.dispose();
          // Encodes image as a JPEG data stream
          FileOutputStream out = new FileOutputStream(resizedFile);
          JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
          JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bufferedImage);
          param.setQuality(1.0f, true);
          encoder.setJPEGEncodeParam(param);
          encoder.encode(bufferedImage);
      catch (Exception e) {
            this.error = e.getMessage();
          return bufferedImage;
    }Edited by: oneworld95 on Nov 8, 2010 11:34 AM

    I don't know anything about the jpeg encoders, but I do see code that doesn't make any sense to me:
    Image resizedImage = null;
    int iWidth = image.getWidth(null);
    int iHeight = image.getHeight(null);
    // This code ensures that all the pixels in the image are loaded.
    Image temp = new ImageIcon(resizedImage).getImage();What is the point of creating an ImageIcon from a null image?
    int newWidth = (int)this.targetWidth;I don't see where you actually use this variable, so how does the image get resized?
    For more help create a [url http://sscce.org]SSCCE, that demonstrates the incorrect behaviour and maybe someone will take a look at it.

  • Sound Check doesn't work for some podcasts?

    Apologies for cross-posting, but this didn't get any replies in the Using iTunes section.
    Podcasts that I subscribe to are recorded at quite different levels. This is pretty annoying when my morning playlist goes from a really quiet one to a really loud one.
    It seemed that Sound Check would be the perfect solution, but not so: while Sound Check has set Volume levels for all the music tracks I checked, and many podcasts, there are quite a few podcasts that Get Info / Summary reports the Volume as "Not available." This doesn't seem to be just a display glitch: when I turn Sound Check on and off, the volume doesn't change on these tracks. As Murphy would predict, the ones that need the most adjustment don't get any
    I haven't been able to work out what is different between the tracks that do and don't have Sound Check volumes. Two example podcasts that do get Sound Check volumes are Slacker Astronomy (most recent episodes) and StarDate; two that don't are Classical Music Spotlight and Writer's Almanac.
    I tried converting one episode to AAC. As expected, the AAC file gets a Sound Check volume. But it's in the iTunes library Music group, not in the podcast.
    Is there any way to get Sound Check to process these other podcast episodes?
    iBook G4, iMac G5   Mac OS X (10.4.8)  

    Sound check is basically useless. Hasn't worked effectively on any model I've purchased. However, as others have pointed out, you can adjust the volume of a song so that your playlists don't cause public embarrassment. Simply do a control "i" on a particular song. In the "info" tab, you can increase or decrease the volume of a particular tune. However, if you make the adjustment, be sure to adjust all of the tune from that album. Otherwise, when you play the album, the song you tweaked will have a different volume from the rest of tunes on the album. It ain't a great fix... but it's better than what the programmers have done with sound check.

  • Mark Clip - X shortcut doesn't work for some reason. Is there an easy way to mark a clip without going into Source Monitor?

    Hi guys,
    I'm using Premiere Pro CC on Windows 8.1 Pro. The Mark Clip function - X shortcut key by default doesn't seem to work.
    I know that if I go into Source Monitor I can mark the clip in there but WHY ? In the old day of CS5.5 I can mark a clip (not timeline) as quick indicator for frame / sound issue of a particular clip. One key press and I'm done.
    So, is there an easy way to mark a clip in Premiere Pro CC without going into Source Monitor?
    Cheers!

    Hi Mark and everyone looking to find the answer,
    After experimenting, I figured out the answer. This applies for the latest version of Adobe Premiere Pro CC (as of 01-Sep-2014) ver 8.0.1 (build 21)
    Context: You want to add a marker to a specific clip instead of a sequence but you can't seem to do it.
    Why?
        - X key (or Mark Clip as Premiere Pro CC calls it) doesn't add a Marker to a clip. What it does is using the clip you are selecting as reference for Mark In / Out of your current sequence.
        - M key (or Add Marker as Premiere Pro CC calls it) will add a marker to your clip.
       HOWEVER:
        If you are not expanding your clip to see the wave form or clip thumbnail, the marker on the clip will not show up. It used to show up in CS5.5!!!!!! Why not in CC!!!?!
        It will only add the marker to the clip you are selecting. Track targeting does not matter.
        If you don't select any clip, it will add a marker to your sequence.
    Example: (This is the same clip and sequence)
    How it looks with marker added.
      Track targeting does not matter - reference number 1
      Current selected clip is is the key - reference number 2
        2.  How it looks with marker added but you can't see
        3.  How it looks if you don't select the clip and hit M
    Hope this help!
    Cheers!

  • TV out doesn't work for some videofiles

    I am using the GEforce 2 mx 400 64 mb
    I have configured the driver as 'klone' .
    Now i've got two outputs of the card at the same time; one to monitor, one to tv (with s-vhs cable)
    It works fine,
    except for  playing videofiles (Mpeg, WMV etc, In mediaplayer 9.0) )
    I can only view at the selected primary monitor the video.
    I know for sure that ,in previous settings i've had two outputs at same time for this videofiles..
    but how? can't find the option anymore..
    (With AVI files, there is not this problem; I can view at Tv and monitor )

    Thanks for the confirmation.
    I think my issue could be the same, as i'm also trying to send audio to the tv via the headphone port. Just saying again to explain better:
    - Tv's have analog audio input for hdmi, but at least for mine, it only uses these inputs if it does (or doesn't) get a certain signal for audio over the hdmi connection.
    - Whatever the 9400 is doing, its convincing the tv to use the analog inputs, all is well.
    - Whatever the 9600 is doing, its convincing the tv -not- to use the analog inputs, thus no sound.
    It was a bit fiddly, but i got it to a state where audio through the headphone port would work fine under the 9400, i would set graphics to high performance, log out, log back in again, and audio would not work. Undoing this (setting the graphics to better battery life and relogging in) would restore sound.
    I'm thinking the root of the issue is that the tv gets detected as supporting audio, and something the 9600 is doing is fooling the tv to think it is receiving audio, though as you suggested it's not supported and nothing is going though.. which has the side effect of igoring the analog inputs we're sending though the headphone jack.
    Some sort of fix to disable audio down the displayport would be great. PC nvidia drivers that i'm running on the same mac in boot camp have an explicit option to do this, so it shouldn't be too hard..
    Or any other work around..
    Thanks!!

  • Skype doesn't work for some numbers

    I'm trying to call Iceland Air - I have my cell number as the caller ID and is verified, but I never get through. I can get through just fine with my cell. I am wondering if the +1 in front of my cell is throwing things off? Or is there a setting that makes Skype hangup when it gets a recording like you do at airlines. However, this doesn't happen other times. but is very consistent with this number.
    In another problem, sometimes when calling local numbers, skype just quits - the whole program, over and over. It is inconsistent with the which number, but I get the message "skype has unexpectedly quit..."
    thanks.

    tontheroad wrote:
    I'm trying to call Iceland Air - I have my cell number as the caller ID and is verified, but I never get through. I can get through just fine with my cell. I am wondering if the +1 in front of my cell is throwing things off? Or is there a setting that makes Skype hangup when it gets a recording like you do at airlines. However, this doesn't happen other times. but is very consistent with this number.
    It is possible that Icelandair is not allowing calls from Skype callers to their toll-free number, or from wherever Skype patches their calls into the US telephone network.  I found their US toll-free number on their web site, and could not get through either.  Those with toll-free numbers in the USA and Canada can define who they receive calls from, since those individuals and organizations are paying for receiving calls to the toll-free numbers.  Other than trying to find another non-free number for them (I didn't see one in the US on Icelandair's web site, but there are some in other countries), that is one that may only work from a US landline or mobile phone.
    Sorry!
    Patrick
    Location/Ubicacion: Arizona USA
    Time Zone/Hora Local: UTC/GMT -7
    If this message has adequately addressed your issue, please click on the “Accept as Solution” button. If you found a post useful then please "Give Kudos" at the bottom of my post, so that this information can benefit others.
    Si esto mensaje le ha ayudado, por favor haga clic en "Aceptar como solución". Si encuentra un mensaje útil, por favor "Da Kudos" al final del mensaje, por lo que esta información puede beneficiar a otros.
    I am not a Skype employee. No soy un empleado de Skype.

  • Agent Assignment Doesn't work For Some Users

    Hi all,
    In OOCU_RESP there are four agents in a responsibility. But only one (say A) of the four gets tasks in Inbox. The other three (say B, C, D) get nothing.
    I removed A from the responsibility and B, C, D still get nothing. In SWIA the log shows no agent assigned. But in SWI2_DIAG there is no error info.
    In OOCU_RESP, Simulate rule resolution, i can get all 4 agents assigned.
    I feel like there is something wrong with B, C, D's SAP account settings. But I have no clue what it can be. Advise please!

    Hi Dayong
    Please check the Agent Assignment settings of the task used for sending the WI to the users. Is the task set to General task or specific agents are listed there?
    PFTC->Supply the Task-> Additional Data -> Agent Assignment
    Also, check if these agents are listed in Excluded agents in the Workflow Step.
    regards,
    Modak

Maybe you are looking for