Parsing of Pound sign?

Hi,
I am retrieving the data frrom database and then creating dom ..but i am unable to transform "Pound Sign" with the help of encoding UTF-8 as well as ISO-8859-1....so pl guide me........thnks

Hi, our team is also having a very similar problem to the one described. I'll try to cover all the bases with the description below.
We are writing java code to interact with a web service that gives us product price information. Some of these prices are in British Pounds (GBP/�). An example element is : <FormattedPrice>�29.57</FormattedPrice>.
The encoding of the XML document returned is UTF-8. All references to pound sign mean '�' - British Pounds.
On windows, we have no problems parsing the output. However on Linux, the document does not parse cleanly at all.
We think that this is due to the platform encoding being iso-8859-15 rather than UTF-8, although I was told this rather unreliably.
The java code doing the parsing is:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputStream in = url.openStream();
doc = builder.parse( new InputSource( in ) );
doc.normalizeDocument();
Then we use XPATH to extract the specific price element.
Our Junit test code expected results i.e
String result = "�12.34"
We see the response XML like this: <FormattedPrice>��29.48</FormattedPrice> with an extra character included.
Here's a summary of our setup:
OS: WinXp sp2 / Linux fedora core 2
JDK: 1.5.0_05
I've set the -encoding javac flag via ant. However I still get a mismatch.
Any suggestions would be greatly appreciated.

Similar Messages

  • Parsing a querystring GET request that has a pound sign (#)

    I apologize if this posting is in the incorrect forum, but I couldn't figure out which one was MOST appropriate, so I chose the most general. I have a Java program that processes a URL request from an external application. The URL is invoked with several query string variables, including one for ShippingAddress. I found yesterday that when their system passes a pound sign (#) in the URL, it crashes my program. Apparently, the pound sign is not just automatically converted to a hex equivalent (%23) like a space(%20) is, for example. So when I try to parse it, it fails. For example, the URL might be something like this:
    http://www.mydomain.com/process.nsf?openagent&shippingaddress=123 Main Street #307
    The spaces do not cause any issues. However, when it comes to parsing the " #307", it dies.
    To parse the query string, I'm using the following utility class. I'm not a Java guru, so my question is if there is a way to modify this class to handle the # sign in the URL? Going to the developers of the other system and requesting they replace the # with a hex value will take months. Thank you!
    import lotus.domino.*;
    import java.util.*;
    public class UrlArguments extends Hashtable {
    public UrlArguments() {
    public void fromString(String args) {
    StringTokenizer toks = new StringTokenizer(args, "&=", true);
    String tok = toks.nextToken(); // first token is command: skip it.
    String key = null;
    boolean bKeyNext = true;
    while (toks.hasMoreTokens()) {
    tok = toks.nextToken();
    if (tok.equals("&")) {
    if (bKeyNext && (key != null)) {
    // Null value
    put(key, "");
    key = null;
    bKeyNext = true;
    } else if (tok.equals("=")) {
    bKeyNext = false;
    } else {
    if (bKeyNext) {
    key = new String(tok);
    } else {
    if (key != null) {
    put(key, tok);
    key = null;
    // We have to special-case a valueless argument at the end.
    if (bKeyNext && (key != null)) {
    // Null value
    put(key, "");
    public void fromSession(Session session)
    throws lotus.domino.NotesException {
    AgentContext agentContext = session.getAgentContext();
    Document doc = agentContext.getDocumentContext();
    // First add all of the CGI variables. They are in the document context.
    Vector items = doc.getItems();
    for (int iItem = 0; iItem < items.size(); iItem++) {
    Item item = (Item) items.elementAt(iItem);
    put(item.getName(), item.getText());
    // Now parse the URL arguments themselves.
    fromString(
    doc.getItemValue("QUERY_STRING_DECODED").elementAt(0).toString());
    // A simple accessor to make casts unnecessary.
    public String getString(String key) {
    return (String) get(key);
    }

    ot just automatically converted to a hex equivalent (%23) # is a valid part of the URL, it is a separator for the fragment part.

  • British Sertling pound sign in XSL

    Hi,
    Can someone please advice on how to put the British sterling pound sign (#) in XSL without the parser modifying it. I have tried the using <xsl:text disable-output-escaping="yes"> but did not work. I am using oracle.xml.parser.v2.oraxsl command line to parse the XML & convert to HTML.
    Any help will be appreciated.
    Thanks,
    Vijayan

    Actually don't worry, I was in the To: field when I clicked the '.?123' button. It doesn't provide the same options in that instance.
    Problem solved.

  • How do i get the pound sign on a uk macbook keyboard?

    eeek so embarassing....but ive a $ and no uk pound sign on my macbook keyboard. yes its a uk model.
    I tried option and 3.....:-(
    no working ......
    pls help. ty so much you lovely people
    CarolineUK

    Curious! £ should be shift - 3
    opt - 3 gives #

  • How do i type a pound sign on my macbook air?

    how do i type a pound sign on my macbook air?

    pricexxx wrote:
    No; this gives me #.
    But now I find that if I press Shift + 3, I get £.
    That means you have the "British" keyboard layout active.  If you had a British hardware keyboard, it would be printed on your 3 key, but I guess you must have a US hardware keyboard.

  • How do I get a pound sign?

    Quite a basic question, but we are British ex-pats living in Oz and we bought our MBP here, so it doesn't have a pound sign on the keyboard. I've tried looking for a keyboard shortcut but I can't find one. Any ideas on how I get the pound (and Euro) signs?
    MacBook Pro, Mac Mini   Mac OS X (10.4.6)  

    Open the International preference pane and select the Input Menu tab. Check the Keyboard Viewer box in the scrolling window and the Show input menu in menu bar box. ( You can also check other boxes that may be useful for you.)
    This creates a menu with the icon of the keyboard set you are using and lets you switch quickly. The Keyboard viewer works like KeyCaps did in the classic systems, where you can hold down any modifier keys and see what different keystrokes will give you. The Character Palette (activated from the same preference pane) also gives you access to those funny characters that can't be accessed from the keyboard. Some applications have links to these palettes and viewers built-in to menus for quick access, like Special Characters from the Edit menu in Safari.

  • Pound Sign (u00A3) in Sender SFTP Channel  - using MessageTransormBean

    Hi,
    I am reading a csv file using Seeburger SFTP Sender Communication channel.
    One of the field has pound sign  like    £250 forTution
    With default UTF-8 codepage I am geting a square symbol instead of £ sign.
    I tried to set codepage to ISO-8859-1 and windows-1252 and other UTF code pages using MessageTransformBean's Transform.ContentType = text/xml;charset=ISO-8859-1
    They are giving some other special characters for £ sign.
    What is the correct code page we should use to read £ sign correctly into payload. Any suggestions are greatly appreciated.
    Regards,
    Ramesh

    Thank you Stefan! That helped me too. I have only one additional remark.
    My problem was that this solution didn’t work at the beginning because the line
    Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion
    was always the first line. Every time I tried to put the ContentType line in the first row it becomes the second after saving.  So I’ve done the following trick. I added the MessageTransformBean twice with the names Plain2XML_Step1 and Plain2XML_Step2 (in this order). In the module configuration part I added the following three lines:
    Plain2XML_Step1 Transform.ContentType text/plain;charset=iso-8859-1
    Plain2XML_Step2 Transform.Class com.sap.aii.messaging.adapter.Conversion
    Plain2XML_Step2 Transform.ContentType text/xml;charset=utf-8

  • Asia/Pacific characters are replaced by the pound sign ("#")

    Having a problem sending e-mails and faxes from SAP (EH&S) that contain Asia/Pacific fonts.  The e-mails look good in SAP but in Outlook the Asia/Pacific characters are replaced by the pound sign ("#").

    System Preferences > Keyboard > Text. Click the + symbol to add a keyboard shortcut. Click in the left empty Replace text window and place GBP there. Tab, and enter option+# (£) in the With text input area. Click outside of this row to set the contents. Exit System Preferences.
    In the application where you wish to have this substitution performed for you, in the Edit menu > Substitutions submenu, select Text Replacement. Then when you type GBP, a floating panel will open below GBP with the pound sterling symbol — just press the spacebar.
    Another approach is to use the special character viewer from the bottom of the Edit menu. If ISO-8859-1 is not one of your categories, use the gear icon in the top left to add it. Click on the £ symbol, and in the enlarged view on the right, click on the Add to Favorites. In the future, when you want to add the pound sterling symbol, launch this character viewer, click on Favorites at the top of the category column, and then double-click the £ symbol to have it inserted at the current pointer location in your document. Not as efficient as typing GBP.

  • I've lost the shift 3 pound sign, only get hash, any ideas?

    Hello - I've lost the shift 3 pound sign and only get the hash - can't seem to change it.
    Any ideas?

    If this happens, you can set the keyboard back to UK by selecting it from the menu bar.
    Simply click the flag icon which you will see near the wireless + bluetooth icon, then change it from the US flag to the UK flag & you keyboard should be back to normal.
    If you cannot find the UK flag which indicates the option to set the keyboard to UK layout, you should be able to add the UK keyboard layout by clicking the "+" symbol & selecting it.

  • US Macbook - how do I get the POUND sign???

    I have a Macbook purchased in the USA and I have no POUND sign on my keyboard - only a $ sign....any ideas?

    sofree wrote:
    I have a Macbook purchased in the USA and I have no POUND sign on my keyboard - only a $ sign....any ideas?
    Here is a handy list. Accent Codes for the Macintosh

  • HT2452 my grandsons were using my computer, now my pound character types as a # sign, how to I get my pound sign back

    my grandsons were using my computer, now my pound character types as a # sign, how to I get my pound sign back

    If you have a british keyboard then they might have changed it to a US keyboard in System Preferences > Language & Text > Input sources tab > check "british" and uncheck US

  • Pound signs (####) returned instead of data

    I have a user that is experiencing a really odd problem. She is running a workbook, and one of the columns is returning pound signs (##########) instead of a number value. The really weird part is that some of the records return a number, and some return the pound sign. When I run this query in SQL, there are no problems. I have tried adjusting the format mask of this column in Discoverer Admin, but to no avail. Does anyone else have any suggestions? Thanks in advance.

    Just to be sure you are changing the data format on the workbook for the data format within either Discoverer Plus or in Discoverer Desktop, correct? Your colums may also be too small to display the data properly, increase their width. It does sound like the data format mask is your problem though. Let me know if I can be of any help.
    Matt Topper
    TUSC, The Oracle Experts
    [email protected]

  • How do i change to a pound sign

    i want to change from using my dollar sign to a pound sign- thanks

    Select British instead of American in
    System Preferences > Language and Text
    or just type option  3

  • ORA-01461 - Inserting pound sign

    Wonder if anyone can help with this issue?
    I'm running Oracle Forms [32 Bit] Version 10.1.2.0.2 (Production) with OC4J 10.1.2.0.2 against Oracle database version 11.1.0.7.0. where the NLS_CHARACTERSET on the database is AL32UTF8.
    NLS_LANG on my machine is:
         SQL> @.[%NLS_LANG%].
         SP2-0310: unable to open file ".[AMERICAN_AMERICA.WE8MSWIN1252]..sql"
         SQL>
    I have a form with a non database block containing a push button and text item field, Data Type - CHAR, Maximum Length - 1000, Data Length Semantics - Null
    create table amc_pound_test
    ( apt_id number
    , text1 varchar(2000)
    Using the button with a When-Button-Pressed trigger I try to insert the text, "£1", into the above table using the following code:
         DECLARE
              aSeq Number;
         BEGIN
              Select NVL(MAX(Apt_Id),0) + 1
              Into aSeq
              From AMC_POUND_TEST;
              Insert Into AMC_POUND_TEST
              ( apt_id
              , text1
              Values
              ( aSeq
              , 'Direct: '||:block3.text1
              commit;
              insert_rec(:block3.text1);
         END;
    Where insert_rec is a program unit defined as:
         PROCEDURE insert_rec ( pi_Text1 amc_pound_test.Text1%TYPE ) IS
              aSeq Number;
         BEGIN
              Select NVL(MAX(Apt_Id),0) + 1
              Into aSeq
              From AMC_POUND_TEST;
         INSERT INTO AMC_POUND_TEST
         ( Apt_Id
         , Text1
         VALUES
         ( aSeq
         , 'Via Proc: '||pi_Text1
         commit;
         END;
    When the Maximum Length of field on the form (:block3.text1) is set to 1000 or less both inserts work fine.
    Once the Maximum Length is increased to more than 1000, e.g. 1001, 1333, 2000 the insert via the Insert_Rec procedure fails with an ORA-01461 error.
    However, if I remove the pound sign, both inserts work fine!
    Any ideas?
    Many Thanks
    Anton

    Seems to be related to Oracle Bug 5143833.
    I'll update if the workaround to set the NLS_LANG to UTF8 works on customer site.

  • How to get a euro or pound sign

    hello guys,
    i wonder if there is a way to generate a euro or pound sign on a mac keybord.
    we do work a lot with currencies and that would come very handy.
    best regards
    chris

    In System Preferences-Keyboard select 'Show keyboard viewer in menu bar'.
    Click on the icon that appears in your menu bar and select 'Show keyboard viewer'.
    Now press opt/alt, ctrl, fn, etc... and it will show you all the characters available on your keyboard.  Also try combinations like shift+alt/opt.
    Apologies for the general answer but I don't know where you are or what international settings are set on your computer and hence what your keyboard layout is.

Maybe you are looking for

  • How do i get my purchases back onto my iTunes account?

    They were all deleted due to an issue with my iPod freezing. I took it in to the Apple store, and they told me EVERYTHING was deleted. Most of my music was purchased, including apps and such, so how do i get them back? It is a rip off if I am not abl

  • BW-WebI Report: MDDataSetBW.GetCellData.  System error in program

    Hi, I'm trying to run a WebIntelligence Report connected with BW Query but return error before showing the results. The error is: Error in MDDataSetBW.GetCellData.  System error in program CL_RSDRC_MULTIPROV and form SETRESOLVE-01- (consid.TxtDescrit

  • 3G Network switches to Edge all the time, Buttons rattle when shaking-

    I originally owned a first generation iPhone (Love it!) but still couldn't resist and got a "3G S" unfortunately I encountered plenty of anomalies with three different ones. If anyone is going through the following, please help acknowledge this to Ap

  • Backspace in vim

    ...it now produces ' ^? ' in insert mode, and doesn't move backwards in command mode. I've upgraded to xorg 7.0, and have generated a new xorg.conf . Any clues?

  • Time remapping in After Effects using Premiere Pro clip

    I'm probably losing it cause this should be idiot proof. I watched the Creative Cow tutorial but he must be using an earlier version of the suite. The problem: I want to remap an 8sec clip and more radically slow down the footage then use the frame b