tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shanta B <>
Subject ? problem
Date Tue, 05 Aug 2003 13:19:25 GMT
     I need ur help ...In our application while creating a task we are
entering taskid,now we are getting some problem when we include EUR symbol
in taskid will replace EUR symbol to &#8364;and it storing in database
also like this ,because of this when user enter 5 EUR symbols it will makes
database problem(taskid length is 16 in db,where as because of these EUR it
will place 5*7=35 characters in db).

I tried with following character sets ISO-8859-1,ISO-8859-15 and also UTF-8.

I have done the following things because of this i am able to display EUR in
gui(character set iso-8859-1) but still i am seeing &#8364; in database.

TaskDisp calls this method(HtsimpleDisp)

public Input makeTextInputField(String name, int size, int maxlen, String
    Input f =null;

    if(value != null)
        f =
        f = makeInputType(Input.TEXT,name,value);

    return f;

this calls siefleet.util.Util package

public static String getEscapedString(String source)
          System.err.println("In getEscapedString "+source);
          StringBuffer result = new StringBuffer();
          for(int i=0; i<source.length(); i++)
              char c = source.charAt(i);
              if(((int)c) < 256){ System.err.println("<<<<<<< 256
              else result.append("&#" + Integer.toString((int)c) + ";");
          return result.toString();

public static String escapeHTML(String s)
        int l = s.length();
        StringBuffer sb = new StringBuffer();
        char[] val = s.toCharArray();
        int i;
        char c;
        for (i = 0; i < l; i++)
            switch (c = val[i])

                case '\n':      sb.append("<br/>"); break;
                case '<':       sb.append("&lt;"); break;
                case '>':       sb.append("&gt;"); break;
                case '&':       sb.append("&amp;"); break;
                case '"':       sb.append("&quot;"); break;
                case 'ä':       sb.append("&auml;"); break;
                case 'ö':       sb.append("&ouml;"); break;
                case 'ü':       sb.append("&uuml;"); break;
                case 'ß':       sb.append("&szlig;"); break;
                case 'Ä':       sb.append("&Auml;"); break;
                case 'Ö':       sb.append("&Ouml;"); break;
                case 'Ü':       sb.append("&Uuml;"); break;
                case '§':       sb.append("&sect;"); break;
                case 'EUR':       sb.append("&euro;"); break; //this is euro
entity value 

                    if (c < 32 || 129 < c)
                        sb.append("&#" + (int)c + ";");
        return sb.toString();

Where as in EditTask we are calling Map taskAttrs =
dumTask.makeTableFromHttpRequest(s,req); this will call

public static String toStringClass(Object o)
     if (o == null)
        return null;
     if (o instanceof String)

       System.err.println("In Javaconverter o is string
       String  myval=(String)o;
       System.err.println("In Javaconverter o is string "+myval);
       return myval;

        System.err.println("In Javaconverter o is string
        //return (String)o;

        String  myval=(String)o;
        System.err.println("In Javaconverter o is string "+myval);
        System.err.println("In Javaconverter o is string after parsing
        return myval;*/
        //return (String)o;
     return o.toString();

My quetion why database storing &#8364; in place of EUR

View raw message