Extra characters getting appended after decoding

Hi All,
I am trying to decode the special characters by using the following function
public static String decode(String str) throws Exception
byte[] b0 = new byte[str.length()];
Pattern p = Pattern.compile(
"\\G(?:=(\\p{XDigit}{2})|[\\p{Graph}\\p{Blank}&&[^=]])");
Matcher m = p.matcher(str);
int idx = 0;
while (m.find())
b0[idx++] = m.start(1) != -1
? (byte)(Integer.parseInt(m.group(1), 16))
: (byte)m.group().charAt(0);
// byte[] b1 = Arrays.copyOf(b0, idx);
return new String(b0, "UTF-8");
But if i decode "=C2=A365=20sheetal " to £65 sheetal..,the decode is proper but it is adding extra characters like £65 sheetal?????? at the end .
How can i make my decode function not to add extra characters?OR HOW CAN I JUST SAVE "£65 sheetal " THIS VALUE??
THANKX

The problem got solved..,its decoding every extended bit values.
The function was changed little bit.Array copy is done using for loop.
public static String decode(String str) throws Exception
byte[] b0 = new byte[str.length()];
Pattern p = Pattern.compile(
"\\G(?:=(\\p{XDigit}{2})|[\\p{Graph}\\p{Blank}&&^=])");
Matcher m = p.matcher(str);
int idx = 0;
while (m.find())
b0[idx++] = m.start(1) != -1
? (byte)(Integer.parseInt(m.group(1), 16))
: (byte)m.group().charAt(0);
// byte[] b1 = Arrays.copyOf(b0, idx);
byte[] b1=new byte[idx];
for(int i=0;i<idx;i++){
b1=b0[i];
return new String(b1, "UTF-8");
Can any one say me,why euro symbol appears as ? in web-ui ,but it is saved in database as euro symbol itself?
Thankx

Similar Messages

  • Spanish characters getting garbled while executing command using Java code

    Hi,
    I try to execute a command using java code. output of the command contains spanish characters. Few of these characters getting garbled after the command execution.
    Runtime r = Runtime.getRuntime();
              Process p = null;
    String pgm="ipconfig /all";
              try
                        p = r.exec(pgm);
    BufferedReader br=new BufferedReader(new InputStreamReader
                                  (p.getInputStream()));
    while((val = br.readLine()) != null){ System.out.println(val);
              catch (Exception e)
                        return (null);
    I tried to run the code using -Duser.language=es -Duser.region=ES -Dfile.encoding=Cp850, but this did nt help. I could see the outputs properly in command prompt,
    If i redirect the output to a text file , it is getting garbled,
    Please let me know to solve this issue.

    884543 wrote:
    Hi,
    I try to execute a command using java code. output of the command contains spanish characters. Few of these characters getting garbled after the command execution.
    Runtime r = Runtime.getRuntime();
              Process p = null;
    String pgm="ipconfig /all";
              try
                        p = r.exec(pgm);
    BufferedReader br=new BufferedReader(new InputStreamReader
                                  (p.getInputStream()));
    while((val = br.readLine()) != null){ System.out.println(val);
              catch (Exception e)
                        return (null);
    I tried to run the code using -Duser.language=es -Duser.region=ES -Dfile.encoding=Cp850, but this did nt help. I could see the outputs properly in command prompt,
    If i redirect the output to a text file , it is getting garbled,
    Please let me know to solve this issue.Set the character set to UTF-8 to your InputStreamReader, for More details on usage refer the java api :
    http://download.oracle.com/javase/6/docs/api/java/io/InputStreamReader.html

  • **Error** Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax error: extra characters found after end of program.

    Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax
    error: extra characters found after end of program.
    I am new to importing classes and I have been practicing
    making a photo gallery. I am stuck and I want to know if someone
    can help me with the error I am getting.
    If it is convenient, you can download and test my .zip at
    www.dhtmlguy.freeservers.com
    Thanks in advance!

    thanks...the small stuff gets me every time.

  • Error 1087 extra characters found after end of program.

    Why am I getting the "error 1087 extra characters found after end of program with this code".
    If (counter == 1) {
    Next_btn.addEventListener(MouseEvent.CLICK,KMT1);
    else {
    Next_btn.addEventListener(MouseEvent.CLICK,KMT1);
    function KMT1(event:MouseEvent):void {
      gotoAndPlay("KMT1");

    thanks...the small stuff gets me every time.

  • Technical issue SAP F110 related issue. getting extra characters in outgoing file from sap.

    Hi Technical guru's,
    SAP system creating a outgoing file through F110- t-code, this outgoing file has extra characters (DOC.NO:)
    We need to remove these extra characters. Once Payment run has been carried out through F110, in SM37 in job spool it is showing like screen attached with name “file from sm37”.
    But when we look in to outgoing file directory extra characters as I mentioned above is appearing below is the related screen attached with name “out gooing file”.
    Gurus can anyone please suggest me where I can check about this. I have checked the program available in the job as well in the F110 transaction.But could not find any hint.
    Programs which I find in SM37.
    SAPF110S
    SAPFPAYM_SCHEDULE
    RFFOSE_B
    Programs which are available in F110.
    RFFOAVIS
    RFFOEDI1
    RFFOSE_B
    Does extra  characters coming through functional configuration (DME configuration) or coming through SAP standard programs.
    I am Technical person. I need to solve this issue guys please help me in this.
    If above information is not sufficient  let me know what are the other information should I provide.

    I didn't get any resolution so far also I can't convert into Adobe form because this is a production issue which should be fix by making the requied setting or changes in SAP script itself we can't go for new developmet for this isuue.

  • I get extra characters with punctuation in my downloads

    I get extra characters at the end of my sentences with my eBook downloads.  How do I get rid of them.

    Hi "g_g_m_mayers"
    I’m sorry but, that’s not an issue…It’s about normal…
    Here for example, is PRS-T2 menu, with all reading books “appearance” selections.  PRS-T2 (Esupport.Sony US)
    About page size:
    If you select from the menu as “font size” the second icon from left, you’ll have the original page layout of the ebook.
    About fonts:
    With fonts all depends on ebook's file.
    If file includes one or more set of fonts, and you select on reader device Font Type “Original”, you’ll have the original fonts on reader and they will be also the same on PC.
    For example:
    If fonts in ebook were, Greek or Cyrillic or calligraphic or special characters, they will be also on reader device Greek or Cyrillic or calligraphic or special and they will be the same even on PC.
    In this case we have the same fonts on PC, on Reader device and on original book.
    But what happens if the ebook’s file does not include set of fonts?
    Reader device will try to type ebook with the built-in characters (Amasis, Frutiger Neue, Helevetica ,Palatino, etc..) and probably they won’t be the same as the original. Reader device, also, doesn’t include special or other language characters and so, probably, you’ll see “strange” characters like “?” “%”, etc.
    On PC now, most of these “special characters” are built-in, so most of times there’s no problem.
    But quite always, PC's ebook viewer software selects different fonts and so we could have:
    Original Book with one type of font, PC ebook with a second type of fonts, Reader device with a third type of fonts.

  • How to get String after Certain Number of particular characters

    I want to get character after certain numbers's of particular character.
    For example following is String
    String testString = "||A|||B||D|R|T|||TEST|||||"
    I want to get "TEST" which is after 12 "|"
    How can I manupulate String to give me characters after 12 "|"
    I will appreciate any help.

    Loop over the string, looking at each char with charAt(itn index).
    Compare each char to '|'.
    If it matches, increment the counter.
    If the counter is 12, then take the substring from your current position in the string to the end.

  • Why do I get extra characters in unix terminal scripts?

    I occasionally use the unix "script" function to save terminal sessions to a text file. I've noticed that if I save man pages, I get repeated characters throughout the text file. Here is an example:
    Joes-MacBook-Pro:~ joe$ script ~/Desktop/ls_manpage.txt
    Script started, output file is /Users/joe/Desktop/ls_manpage.txt
    Joes-MacBook-Pro:~ joe$ man ls | cat
    LS(1) BSD General Commands Manual LS(1)
    NAME
    ls -- list directory contents
    SYNOPSIS
    ls [-ABCFGHLPRTWZabcdefghiklmnopqrstuwx1] [file ...]
    DESCRIPTION
    For each operand that names a file of a type other than directory, ls
    [etc.]
    When I open the text file in Textwranger, it looks like this:
    Script started on Fri Nov 9 11:05:02 2007
    Joes-MacBook-Pro:~ joe$ ls  man ls | cat
    LS(1) BSD General Commands Manual LS(1)
    NNAAMMEE
    llss -- list directory contents
    SSYYNNOOPPSSIISS
    llss [--AABBCCFFGGHHLLPPRRTTWWZZaabbccddeeffgghhiikkllmmnnooppqqrrssttuuwwxx11] [f_i_le ._..]
    DDEESSCCRRIIPPTTIIOONN
    [etc.]
    Can anyone explain where the extra characters are coming from?

    Interesting. I tried to duplicate your results and I find that script doesn't work at all for me under 10.4.10. I just get an empty file, except for the last line that tells me "Script done on (date)".
    If you look at your script output using od -c you'll find that there are even more extra characters.
    NNAAMMEE
    ... has back spaces embedded ...
    N^HNA^HAM^HME^HE
    ... because this how ancient printers did bold face and underlining.

  • JMS Adapter - data conversion xml- structured data has extra characters

    Further to [Using MQ / JMS adapter with legacy system to talk to SAP;, I am using the Module tab on my receiver JMS Adapter to convert the xml payload to a structured format. It converts to the mainframe ebcdic code set.  I am on PI 7.11, and the MQ Series (which JMS interacts with) is 6.0.  The code I have is comparable to the wiki:[http://wiki.sdn.sap.com/wiki/display/XI/HowTo...ContentconversionmodulewithJ2EEJMS+adapter], i.e. the example at the very bottom of that article.
    The issue we are having is that an extra character gets inserted at the end of each structure (within the message), i.e. our message contains 4 structures, but when we view the structured data on our mainframe system (that arrives from PI), the entire message is shifted by 4 characters... by 1 after the end of each structure.  On the mainframe, this extra character appears as '.'. It must be an end-of-line or something...
    Has anyone had the same issue?  If so, were you able to resolve? I could probably set up my message data type to just be one big declare (thus eliminating the use of structures within it), but that is something I'd rather not do.
    We are in the process of reviewing Note 856346, #6 but not sure if it applies.
    Regards,
    Keith

    Hi,
    check localejbs/SAP XI JMS Adapter/ConvertMessageToBinary Local Enterprise Bean convert_XI2Bin
    this is not CallJMSService.
    And also check the receiver Structure, if it is falt structure its ok, else
    see the below link if it has the complex structure , how to handle..
    See the below links
    /people/alessandro.guarneri/blog/2006/01/04/jms-sender-adapter-handling-too-short-lines
    /people/william.li/blog/2006/11/13/how-to-use-saps-webas-j2ees-jms-queue-in-exchange-infrastructure
    content conversion
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
    Regards
    Chilla..

  • Why does it say i have extra characters in this function?

    why does it say extra characters?
    1087: Syntax error: extra characters found after end of program.
    Symbol 12.addEventListener(MouseEvent.onRelease,exit);
    function exit(evt:MouseEvent):void {
        -root.nav_mc.gotoAndPlay(2);  
         -root.page1_mc.gotoAndPlay(30); 

    http://www.megaupload.com/?d=HYR51BPM
    that is the link to upload my website so far... i am following the tutorial from this site:
    http://www.flashvideotutorials.info/paidarea.html
    im on the adding pages 2 part, but he is using as 2 and im using as 3
    i cant figure out how to get the pages to work right.... please help me out
    thanks
    Kyle

  • BUG: Extra characters at the end of attachment file names

    I received complaints that my attachments didn't open on the PC's of the recipients. After I saw the messages I noticed there were extra characters at the end of their file names. That's why they wouldn't open. When I looked into my sent mail folder it was there as well. The addition took place when I sent the mail, while composing everything looked fine. It took me a while to realize the pattern. There was one extra for every non-ASCII character in the file name.
    Apparently Mail.app is using two different libraries. The other one counts the non-ASCII characters as two while the other doesn't. I don't know whether Finder still uses MacRoman or Unicode, but this seems to relate to double-byte characters.
    The short term solution is to use only ASCII for file names, but that's not what OS X is all about.

    The class files are broken. Recompile them. If you're uploading them, doublecheck if the FTP program used doesn't do mad things with binary files.

  • Convert PDF font ITCFranklinGothicStd-MdCd add extra characters with CR2008

    My customer has several reports that are used the ITCFranklinGothicStd-MdCd font.
    We've had some users tell us that their reports are showing extra characters - specifically, it inserts the letter "i" after every lower-case "f". For example, 'Ref.' becomes 'Refi' and 'For' becomes 'Fior' (there's no letter "i" inserted after the capital "F" - it only inserts after lower-case).
    We've determined that the problem is due to the fact that we're using the ITCFranklinGothicStd-MdCd font; if we use a different font, it works fine. Also, if the end-user copies text from the generated PDF and pastes it into another document, it renders the correct spelling. So for example if they copy "Fior" out of the PDF and paste it into Notepad, it shows "For" as it normally should.
    We cannot change the font, but we should solve the problem.
    Use Crystal Report 2008 and Adobe Acrobat 9.
    How can I solve?

    Hi Ivan,
    This seems like it's PDF issue. You said "So for example if they copy "Fior" out of the PDF and paste it into Notepad, it shows "For" as it normally should."
    This suggests to me that PDF is having problem rendering that font.
    Do they have a TTF version of that font?
    What happens if you export to Word format, do you see it correctly?
    You may want to post your question to Adobe's forum and possibly the the makers of the font also.
    Thank you
    Don

  • I open facebook login page on my android phone, enter email Id and when i enter a character in the password field. Few characters get entered automatically.

    When i enter something in the email id field, and then shift the focus to password field and press any character. Some characters get being displayed automatically in password field( equal to the no. of characters entered in the email id field) . For example, i have entered below id in the email id field:
    Username: [email protected]
    And moved the focus to the password field and press h. Following will be displayed in the password field. Few characters(equal to the no. of characters in the username field .i.e. 9 in this case) are shown before 'h'.
    Password: .........h

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    The Firefox cache temporarily stores images, scripts, and other parts of websites while you are browsing. <br>
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies, do the following:
    #Tap the menu icon located at the top right corner. This is the icon with 3 bars. On older Android devices you'll have to press the hardware menu key and then tap More.
    #Tap '''Settings'''.
    #After that, you will be taken to the settings screen. In the settings screen, look under the section '''''Privacy & Security''''' and select '''Clear private data'''.
    #You will then be taken to a list of what can be cleared. Select the following 2 for deletion:
    #*Cookies & active logins
    #*Cache
    #After those have been selected, tap the '''Clear data''' button to actually clear the cache and cookies.
    Did this help you with your problems? Please let us know!

  • Permitted extra characters in BW

    Hi,
    we are loading material master data and get an error message:
    Charachter µ (lower case Mu) is not permitted. We are on BW 7.0.
    We didn't have any problem with BW 3.5 as we have maintained it in permitted extra characters in RSKC. I tried to copy extra characters (RSKC) from BW 3.5 in BW 7.0, but it doesn't work for Charachter µ (lower case Mu). It makes a capital M in RSKC in BW 7.0
    Any suggestions.
    Thanks

    In a UNICODE system it's doing the right thing. Remember that Mu (character µ) is M in the Greek alphabet, so the system is "translating" the character µ from Greek to M in English (capital M as you may have ALL_CAPITAL in your RSKC settings. This will also happen for ? (ALPHA) as A in English or ? (Beta) as B in English.
    Now the symbol µ was taken for the Micro symbol in the 255 ASCII table (non-UNICODE systems) so there's a "confussion" between the letter MU in Greek (UNICODE 03BC) and the Micro symbol (UNICODE 00B5).
    Try customizing the program to interpret 03BC to 00B5 or you may set the RSKC to ALL_CAPITAL_PLUS_HEX.
    Hope this works.
    Jesus
    Edited by: Jesus Cova Graffe on Feb 19, 2008 4:03 PM

  • Deleting extra characters

    Is there a way to delete extra characters in a StringBuffer after the first occurance? For example, if I wanted to delete all comma's after the first occurance in a string, this seems to work:
              if(custName.lastIndexOf(",") > custName.indexOf(","))
                   custName.replace(' ,' , ' ');
    But how would you do this in a StringBuffer? I have tried using something like this:
    int numComma = 0;
    for(int i = 0; i < letter.length(); i++)
    if(letter.charAt(begin) == ',')
         numComma ++;
    if( letter.charAt(begin) == ',' && numComma > 1)
         letter = letter.deleteCharAt(begin);
    but it deletes all commas, including the first occurrance..Would you use the same approach to delete extra spaces between words?[if there is more than one space] Any suggestions would be appreciated..

    if you use java.util.stringtokenizer you can tokenize by your delimiter.

Maybe you are looking for

  • CREATION OF NEW MOVEMENT TYPE

    Hi,        I have a query regarding creation of a new Movement Type. Is there any specific rule to start creating new Movement Type only with numbers starting with digit 9 or we can consider numbers starting with any digits. Please clarify this as so

  • Performance and Contention problem with the database ?

    Hello! I am having one database which is used by around 95 thousand users.Database contain about 4 lakh records. The database is going smooth and perfect. The problem(perfomance is slow and there is contension too) came when i made 4 web applications

  • How do I find duplicate lines in Oracle Spatial?

    Hi, I am looking at all of the Oracle locator/spatial functions and I am wondering how to I find if two lines, or two polygons are the same? That is a user has partially loaded more lines into the database and the data had previously been loaded. I d

  • Applet is caching

    I have a JSP which loads an applet. This JSP contains some parameters which get set depending on who you are logged in as. When the applet loads, it reads in these parameters and displays certain things dependant upon those parameters. When I log in

  • No video on import

    Trying to import video - deck is recognised and cued-up etc. but message appears 'Operation could not be completed as there is no video'. Went to help pages, deleted QT receipts as instructed and downloaded, once again, latest QT version. Same proble