Problem in parsing date having Chinese character when dateformat is 'MMM'

I m calling jsp page using following code:
var ratewin = window.showModalDialog("Details.jsp?startDate="+startDate,window, dlgSettings );
In my javascript when checked by adding alerts I m getting correct values before passing to jsp,
alert("startDate:"+startDate);
In jsp page my code is like below:
String startDate = request.getParameter("startDate");     
but here I m getting garbage values in month when the dateformat is 'MMM', because of which date parsing is failing.
This happens only Chinese character.
following 2 encoding are already in my jsp page,can anyone help to find solution?
     <%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
     <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"/>
I have even tried to read it as UTF-8 but still that's failing.

This is my actual code
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class TestingDate {
      * @param args
     public static void main(String[] args) {
          // TODO Auto-generated method stub
          String dateFormat="EEEE, MMM d h:mm a";
          Date test=new Date(2007,0,19, 19, 31);
          System.out.println(" original date is "+test);
          String stringResult=DateToString(test,dateFormat);
          System.out.println("Date to string is "+stringResult);
          Date dateResult=stringToDate(stringResult,dateFormat);
          System.out.println(" String to date is "+dateResult);
          String stringResult2=DateToString(dateResult,dateFormat);
          System.out.println(" Date to string  is "+stringResult2);
public static String DateToString(Date test, String dateFormat) {
         String result = null;
         try {
              DateFormat myDateFormat = new SimpleDateFormat(dateFormat);
                 result = myDateFormat.format(test);
                 //System.out.println(" reslut date is "+result);
          } catch (Exception e) {
               System.out.println(" Exception is "+e);
          return result;
public static Date stringToDate(String strDate,String dateFormat1){
     Date result1=null;
     try {
          DateFormat myDateFormat = new SimpleDateFormat(dateFormat1);
          result1=myDateFormat.parse(strDate);
     catch(Exception e){
          System.out.println(" exception is "+e);
     return result1;
}I am facing problem in getting the actual date. Please suggest the solution.

Similar Messages

  • NetBeans problem: Issue with servlets and Chinese character encoding

    Java Version: JDK1.5.0_01, JRE1.5.0_01 (International version)
    Netbeans Version: Netbeans IDE 4.0
    OS: Windows XP Personal Edition
    Dear Sirs,
    First at all thanks for reading this post. I am having the following issue. I am creating an application using html pages and servlets. I am using Chinese and English languages on them (html encoding UTF-8).
    I created a project in Netbeans and added an idex.html screen reporting to a servlet. Both index.html and in the servlet generated html page contains the line:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    Additional, I setup the character code settings in Netbeans:
    (tools-options-Java sources-Expert-default encoding=UTF-8
    When I run the project, index.html displays itself perfectly, with the Chinese characters displayed properly. The problem comes when the html created servlet is displayed, which instead of the Chinese characters some strange characters are displayed (�� instead of Chinese).
    I have tried different encodings from http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html without any luck. I also setup the encoding of the file itself (using right click-properties in the project menu of Netbeans).
    Also, when I am editing the servlet, the characters are displayed properly. I type them directly without any issue, but then the display is wrong at runtime.
    Also, just in case this have something to do with the problem, my PC was bought in US, therefore the default character set is not Chinese. I had to install the Chinese typing stuff later on. But like I said earlier, the html page is displayed properly, so I really think is some problem with Netbeans.
    After a week trying to find a solution, I decided to post it here in the hopes that someone will show me the way of the light.
    Thanks in advance for any ideas or help provided
    Aral.

    Ok, I found out some problems with Netbeans as well.
        public void doGet(HttpServletRequest request,
                          HttpServletResponse response)
            throws IOException, ServletException
            response.setCharacterEncoding("UTF-8");
            request.setCharacterEncoding("UTF-8");
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            byte[] st = {-25,-75,-124,-27,-100,-106,-17,-68,-102,-27,-80,-113,-27,-72,-125,-26,-118,-75,-26,-105,-91,-27,-82,-93};
            out.println("this works: ");
            out.println(new String(st,"UTF-8"));
            out.println("<br>");
            out.println("this doesn't: ");
            out.println("some chinese copied from the Internet<br>");Right click the .java file and choose properties -> encoding UTF-8
    Then I make a copy of the .java file, rename it to html and open it with IE sure enough
    the Chinise is allready unreadable (not it's still readable in the IDE);
    When I compile the file with F9 I get the following error:
    whatever.java:101: warning: unmappable character for encoding Cp1252
    Tried to set the encoding to UNICODE but then the file doesn't compile.
    I gues you have to download the Japanese version for it to work correctly.

  • Loading data having newline Character

    Hello Everyone,
    I am trying to load a .csv file to a single table using SQL Loader.
    Sql*loader 11.2.0.1.0
    Operating system: Windows 7
    My control file is as follows
    LOAD DATA
    INFILE 'C:\Test.csv'
    Into table TEST
    Fields terminated by "," optionally enclosed by '"'
    TRAILING NULLCOLS
    name ,
    group,
    description
    Test.csv File is as follows
    Sam, Developer, "This is test data,This is Test data. Tis is test data this is test data,Tis is test data
    Test1Test2
    Test1 Test2
    ", Anna, PM,"This is testdata
    This is test data@Test
    this is test data
    newline character Test
    "newline character Test:Test Data Test data""
    My log file gives me an error
    Record : Rejected - Error on table TEST, column DESCRIPTION.
    Initial enclosure character not found
    Record : Rejected - Error on table TEST, column DESCRIPTION.
    second enclosure string not present
    Help Please!

    Looks like you have syntax errors :
    Cause: A mandatory initial enclosure delimiter was not present. Either it is missing on the current field or the previous field is missing an identical closing delimiter.
    Action: Supply the missing delimiters.
    Cause: The logical end of record or the end of a LOBFILE was reached before a second enclosure delimiter was found.
    Action: Correct the datafile to include the missing delimiter.
    Regards

  • Download data from db to CSV file and need to handle chinese character

    Hi , all , I need to write to alow to export data from db to csv file, now the problem is some column is chinese character, in both db and web page it can dispaly the chinese, but in Csv I can't display chinese character, what should I do?
    Thnak you

    HJava wrote:
    I already have res.setCharacterEncoding("UTF-8"); in my servlet, and db
    req.setCharacterEncoding("UTF-8");
    Are you sure that you have set it on the response? You do not need to set it on the request. Have you read the article? Do you understand the world of characters? It look like you still don't understand it.
    by the way, since csv is text file , how can I bold my University number??? in sb = new StringBuffer();
    sb.append("University Number");Not possible with CSV since it is text/plain. Use real XLS if you want to add formatting to cells.

  • PSP: problems with viewing data

    Hello.
    I'm currently working at on-line shop and have some problems with viewing data from database. When there is no much inserts to table its working very well. But after inserting all Inserts I have its acting weird.
    Sample with 10 INSERTS:
    http://gafgarion.atspace.com/psp/1.jpg
    Sample with 100 INSERTS:
    http://gafgarion.atspace.com/psp/2.jpg
    I'm using Oracle 9i. when I have more data in my database its acting weird. There is SELECT only from one table, but sometimes I have data from other tables aswell.
    I didnt touch any config files or something else. Only created new User and DAD.
    any ideas what should I do to fix that ??
    thnx in advice

    Hello,
    My guess is that you are speaking about PLSQL Server Pages (PSP), and the PLSQL Web Toolkit.
    This is why I do not think that you will have lot of answer since this forum is targeted toward Web Services developer (XML, SOAP, and so on)
    I am inviting you to ask your question on the general Oracle Application Server - General or PLSQL forums.
    Regards
    Tugdual Grall

  • In condition records section Search help problem at one data type

    hi there,
    we are upgrading 4.6c version to ecc 6.0 past january. but in
    vk11/vk12/vk13 condition master records sections, we have a problem for
    one data type search help. when we want to join sales deal code to sales
    detarmination condition, at one tables rows type price list (data type =
    pltyp_d) does not allow f4 (search help).
    thanks your interesting.
    Sinan Alt&#305;ner
    Betek Boya ve Kimya Sanayi A.&#350;.
    SAP CONSULTANT / ABAP Developer

    Hi surya,
    I per your suggestion i did like this ,
    data : date1 like sy-datum.
    types : w_date1 type sy-datum.
    date1 = w_date1(ztable-date1). "ztable-date1 - is screen field.
    but it is giving error "The field "W_DATE1" is unknown, but there is a field with the similar name "DATE1" . . . ."
    actually that value is coming after triggering PBO event but i want that value in at time of calling F4 help at that screen filed
    suppose on screen the fields like
    date : 30.08.2008.
    matnr : ( .............F4 )  '".....on this field when i m pressing F4 that time only that above date materials should come as per my first query see my first thread.
    thanks,
    Sanket.

  • PLSQL Server Pages (PSP): problems with viewing data

    Hello.
    I'm currently working at on-line shop and have some problems with viewing data from database. When there is no much inserts to table its working very well. But after inserting all Inserts I have its acting weird.
    Sample with 10 INSERTS:
    http://gafgarion.atspace.com/psp/1.jpg
    Sample with 100 INSERTS:
    http://gafgarion.atspace.com/psp/2.jpg
    I'm using Oracle 9i. when I have more data in my database its acting weird. There is SELECT only from one table, but sometimes I have data from other tables aswell.
    I didnt touch any config files or something else. Only created new User and DAD.
    any ideas what should I do to fix that ??
    thnx in advice

    Hello,
    My guess is that you are speaking about PLSQL Server Pages (PSP), and the PLSQL Web Toolkit.
    This is why I do not think that you will have lot of answer since this forum is targeted toward Web Services developer (XML, SOAP, and so on)
    I am inviting you to ask your question on the general Oracle Application Server - General or PLSQL forums.
    Regards
    Tugdual Grall

  • Hong Kong Chinese Character

    Hi,
    I have problems in displaying "Hong Kong Chinese Character" (&#39321;&#28207;&#23383;) in Oracle forms from client side(using Developer 2000).
    I have already downloaded the patch supplied by HKSAR website and can display and type these characters in the browsers but still cannot see it in the forms.
    I tried other machines, some can display well. Any suggestions? Many thanks in advance.

    Hello,
    I'm using Oracle 10g R2 and my database NLS settings are -
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_CHARACTERSET WE8ISO8859P1
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    I wish to change some of the parameters so that it supports chinese. Although NCLOB or NVARCHAR2 supports well but only if chinese characters are posted directly to it.
    It fails, if unicode generated by some other porgram, say a java application, is posted to the same column and later on fetched and displayed in browser.
    Thanks & regards,
    Sanjeev.

  • Chinese character displaying as ???? in excel  while importing data from sql-server 2000

    Hi everyone,
    I am facing a problem while importing sql-server 2000 data in
    excelshhet .There is some chinese character in database table.
    After importing data in excel chinese character looks like
    ????????.In sql-server this chinese character looks like square
    field.
    I am using UTF-8 .
    This is last hope.
    vijay k singh
    Text

    I was having the same problem with the AIRSQL i couldn't find how to rencode my csv file...
    So i resave the csv in xls and then chose the utf-8 thingy and then just changed the extension back to csv.
    i was always wondering why i had an xls file in my source code, which was just left there from the previous reencoding, i guess
    hope it helps

  • JSON.parse: unexpected non-whitespace character after JSON data

    I am having problem using cold fusion and jquery.ajax it will throw error
    JSON.parse: unexpected non-whitespace character after JSON data
    this is the response in firebug {"EMPCODE":"E-00001"}
    child.cfm
      <cfif IsDefined("empmycode")>
             <cfset  myarray= getempCode(#mycode#)>
             <cfoutput>#myarray#</cfoutput>
      </cfif>
    <cffunction name="getempCode">
           <cfargument name="empcode">
             <cfquery  name="empQuery" datasource="#datasource#">
                   Select empcode from employee where empcode = '#empcode#'
             </cfquery>
                <cfset mystruct = StructNew()>  
                <cfset mystruct.empcode=#empQuery.empcode#>
            <cfreturn   SerializeJSON(mystruct)>
      </cffunction>
    parent.cfm
    $.ajax({
        type: 'post',
            data: {empmycode:empcode}, 
        url: 'child.cfm',
        success:function(data){
        var myobjc = jQuery.parseJSON(data);
        console.log(myobj.empcode);
    Thank you in advance

    jemz wrote:
      <cfif IsDefined("empmycode")>
             <cfset  myarray= getempCode(#mycode#)>
             <cfoutput>#myarray#</cfoutput>
      </cfif>
      <cffunction name="getempCode">
           <cfargument name="empcode">
             <cfquery  name="empQuery" datasource="#datasource#">
                   Select empcode from employee where empcode = '#empcode#'
             </cfquery>
                <cfset mystruct = StructNew()>  
                <cfset mystruct.empcode=#empQuery.empcode#>
            <cfreturn   SerializeJSON(mystruct)>
      </cffunction>
    The above code is confusing. You test for the existence of empmycode, yet you actually use mycode instead. In addition, what you call an array isn't, and you fail to 'var' the method's local variables.
    You could modify the code, by scoping, as well as bearing in mind what Carl has said:
    <cfif IsDefined("form.empmycode")>
        <cfset  code= getempCode(form.empmycode)>
        <cfoutput>#code#</cfoutput>
    </cfif>
    <cffunction name="getempCode">
    <cfargument name="empcode">
    <cfset var mystruct = StructNew()>
    <!--- Alternative:  <cfqueryparam cfsqltype="cf_sql_varchar" value="'#arguments.empcode#"> --->
             <cfquery  name="empQuery" datasource="#datasource#">
                   Select empcode from employee where empcode = <cfqueryparam cfsqltype="cf_sql_integer" value="'#arguments.empcode#">
             </cfquery>
    <cfset mystruct.empcode=empQuery.empcode>
    <cfreturn   SerializeJSON(mystruct)>
    </cffunction>

  • Chinese Character data load issue in BW

    Hi All,
    we are facing an issue with the Chinese characteristics in SAP BW system!
    Our source is SRM system where it has Chinese characters , when we extract the data all the Chinese characters displaying
    as   ####.. Chinese language pack is already installed in  our system, still it is showing garbage values.
    Please help us what need to be done to get the Chinese characters display correctly in BW system
    Ps Note: we tried to load the Chinese characters from excel using the Unicode,  it worked!
    Regards,
    J

    Hi Arun,
    Thank you for your reply
    Yes Ours is a Unicode system only.
    Things to check :
    1. Have you set RSKC to ALL_CAPITAL?
    we have set  ALL_CAPITAL_PLUS_HEX
    2. Does your file have only chinese or other characters in it as well - Korean - and if I remember right - thre are two chinese scripts available - which one are you using ..?
    we are extracting the data from SRM system, Its a standard extract.
    Loading data with Flat file doesn't have any problem, we were able to see the data in Chinese language
    3. If your data is getting activated - check the table contents using SE16 Standard view ( the option that you get in user parameters - DO NOT CHOOSE ALV GRID ) - then you will see the data as it got loaded.
    When we check the data in PSA itself , it is showing as ####
    Regards,
    J

  • Indexes not getting used in schema having chinese data

    I have a database with chinese data in it. When i execute few queries in that schema it does not use the available indexes of that table. Query takes long time to execute and the temp tablespace gets full. But when i execute the same query in another schema having english data the query executes quickly and uses all the indexes.
    I tried gathering database statistics and rebuilding the indexes but that did not work out as well.
    Can any body tell me whether the index creation differs for foreign languages? Do i need to create the indexes differently then normally we create?
    why the indexes are not being used in the schema having chinese data?
    Edited by: user621442 on Dec 17, 2009 10:03 AM

    user621442 wrote:
    I have a database with chinese data in it. When i execute few queries in that schema it does not use the available indexes of that table. Query takes long time to execute and the temp tablespace gets full. But when i execute the same query in another schema having english data the query executes quickly and uses all the indexes.
    I tried gathering database statistics and rebuilding the indexes but that did not work out as well.
    Can any body tell me whether the index creation differs for foreign languages? Do i need to create the indexes differently then normally we create?
    why the indexes are not being used in the schema having chinese data?
    Edited by: user621442 on Dec 17, 2009 10:03 AMHi,
    I do not think so index would behave differently for different languages, yes sorting may behave in a diffierent way.
    Can you post the explain plan from both the database.
    And also nls_sort parameter from both the database.
    I believe that you have order by clause which is not able to sort using index.
    Regards
    Anurag

  • HT6058 I have updated my I pad dut I'm still having problems my iPad seems to freeze and when I go to put in my pin it take a few seconds before the numbers go in and my games stop and start and stop and start for a bit before they run properly

    I have updated my I pad dut I'm still having problems my iPad seems to freeze and when I go to put in my pin it take a few seconds before the numbers go in and my games stop and start and stop and start for a bit before they run properly

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased.
     Cheers, Tom

  • Get Chinese Character Problem

    Hi,
    i'm facing a problem when i try to get the Chinese word from database. It should display "�W��������" rather then "?????".
    i tried to change the page encoding from "UTF-8" to "GB2312" but it still doesn't work.
    Anyone have any idea on this?
    Thanks.
    null

    Hi,
    I have no problem with getting the chinese character in my localPC with the following code.
    <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    But when i upload it to linux server and access it in my local PC, i found the same problem occured. So, i added
    request.setCharacterEncoding("UTF-8");
    As i need to pass this value to another page, so i encode it by using URLEncode like below before go to the other page :-
    artistName = java.net.URLEncoder.encode(artistName,"UTF-8");
    Anyone can help me on this?
    Thanks
    null

  • The problem of Chinese character Mis-coding

    The version of my bea weblogic workshop is 8.1.3(build 2004.0630.115102).When I wrote some Chinese character in the jsp file,the Mis-coding appear.How can I resolve this problem?

    Thanks for your reply.
    I install the workshop on the window2000,and it's a locale specific one.
    I have resolve the problem with my workmate.Just open the menu->Tools->IDE Properties->Display,set the window font as Default and set the Source view font as Chinese character.Then everything is ok in restarting the workshop.

Maybe you are looking for