SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    greek string through an html form

    Hello! I have an html page, which contains the following form:

    <form action="adduser.jsp" method="post">
    Username <input type="text" name="user" />
    Password <input type="password" name="psw" />
    <input type="submit" value="Register" />

    Then in the adduser.jsp page I get the name with the command:
    String name = request.getParameter( "user" );

    The problem is when I give greek names. For example, if I insert the name "νίκος" the result in the jsp page is "???".
    I tried adding " accept-charset="iso-8859-7" ", which is recommended for greek, but nothing happened. Any ideas?

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Set the page header as "UTF-8". Will be works fine

  3. #3
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had the same problem with my JSP page that uses charset UTF-8. I discovered that by deleting the "method" property at the form tag then greek letters submitted correctly.

    So replace <form action="adduser.jsp" method="post"> with <form action="adduser.jsp">

  4. #4
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found that you do not have to remove the "method" property at form tag but insert a code line at the top of all your html tags and code to set the character encoding. The code line is here below.

    <% request.setCharacterEncoding("UTF-8"); %>


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •