How can I let my servlet to process Chinese Character as an input?

How can I let my servlet to process Chinese Character as an input to my simple database which is an Excel file. I have tried before and all my input values become question marks.
Please give me some advise, thx!

input chinese?����������
that may result from the tomcat or other web server

Similar Messages

  • How can i convert jstring to PSTR with chinese character

    Hi all,
    I'm not an expert of C++. So please help me to fix the following problem.
    I'm using jni to call the dll. In java side, the input parameter is jstring. In C++ side, the input parameter of PrintDrugReceipt are PSTR.
    The following is the code of my C++:
    #include <windows.h>
    #include <stdio.h>
    #include <jni.h>
    #include "DrugReceiptWrapper.h"
    #include "DrugReceipt.h"
    const char * JNU_GetStringNativeChars(JNIEnv *env, jobject obj, jstring jstr) {
    jbyteArray bytes = 0;
    jthrowable exc;
         jclass cls;
         jmethodID getBytes;
    char *result = 0;
    if ((*env)->EnsureLocalCapacity(env, 2) < 0) {
    return 0; /* out of memory error */
         cls = (*env)->GetObjectClass(env, obj);
         getBytes = (*env)->GetMethodID(env, cls, "getBytes","()[B");
         //jbyteArray buf = (jbyteArray*)(*env)->CallObjectMethod(env, obj, jlprSourceChiName, getBytes);
         bytes = (*env)->CallObjectMethod(env, jstr, getBytes);
         exc = (*env)->ExceptionOccurred(env);
         if (!exc) {
             jint len = (*env)->GetArrayLength(env, bytes);
             result = (char *)malloc(len + 1);
             if (result == 0) {
                 //JNU_ThrowByName(env, "java/lang/OutOfMemoryError", 0);
                 (*env)->DeleteLocalRef(env, bytes);
                 return 0;
    (*env)->GetByteArrayRegion(env, bytes, 0, len, (jbyte *)result);
    result[len] = 0; /* NULL-terminate */
    } else {
    (*env)->DeleteLocalRef(env, exc);
    (*env)->DeleteLocalRef(env, bytes);
    return result;
    JNIEXPORT jlong JNICALL
    Java_TestPrint_PrintDrugReceiptWrapper(
    JNIEnv *env, jobject obj,
    jstring jlprPrinterPort, jstring jlprSourceChiName,
    jstring jlprTargetChiName, jstring jlprPrintData1,
    jstring jlprPrintData2, jstring jlprCaseNo, jstring jlprReceiptNo){
         PSTR lprPrinterPort;
         PSTR lprSourceChiName;
         PSTR lprTargetChiName, lprPrintData1;
    PSTR lprPrintData2 , lprCaseNo, lprReceiptNo;
         printf("before %s", jlprSourceChiName);
         lprPrinterPort = (*env)->GetStringChars(env, jlprPrinterPort , 0);
         lprSourceChiName = (*env)->GetStringChars(env, jlprSourceChiName, 0);     
         lprTargetChiName = (*env)->GetStringChars(env, jlprTargetChiName, 0);
         lprPrintData1 = (*env)->GetStringChars(env, jlprPrintData1 , 0);
         lprPrintData2 = (*env)->GetStringChars(env, jlprPrintData2 , 0);
    lprCaseNo = (*env)->GetStringChars(env, jlprCaseNo , 0);
         lprReceiptNo = (*env)->GetStringChars(env, jlprReceiptNo , 0);
         PrintDrugReceipt(lprPrinterPort, lprSourceChiName, lprTargetChiName, lprPrintData1, lprPrintData2, lprCaseNo, lprReceiptNo);
         (*env)->ReleaseStringChars(env, jlprPrinterPort , lprPrinterPort);
         (*env)->ReleaseStringChars(env, jlprSourceChiName, lprSourceChiName);
         (*env)->ReleaseStringChars(env, jlprTargetChiName, lprTargetChiName);
         (*env)->ReleaseStringChars(env, jlprPrintData1 , lprPrintData1);
         (*env)->ReleaseStringChars(env, jlprPrintData2 , lprPrintData2);
         (*env)->ReleaseStringChars(env, jlprCaseNo , lprCaseNo);
         (*env)->ReleaseStringChars(env, jlprReceiptNo , lprReceiptNo);
         return 1;
    the h file:
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class TestPrint */
    #ifndef _Included_TestPrint
    #define _Included_TestPrint
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: TestPrint
    * Method: PrintDrugReceipt
    * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J
    JNIEXPORT jlong JNICALL Java_TestPrint_PrintDrugReceiptWrapper
    (JNIEnv *, jobject, jstring, jstring, jstring, jstring, jstring, jstring, jstring);
    #ifdef __cplusplus
    #endif
    #endif
    Note: the jstring input parameters are the chinese character. If i print out the jstring, it will display dirty character, why? and how to fix it? and the PrintDrugReceipt will expected accept the chinese character and print it to the printer.
    Thank you for you guys help.
    Matthew

    you can't use char...have to use a wchar....and look around at the wide character handling function in C/C++.

  • How can I pass parameters from one process flow to another process flow?

    How can I pass parameters from one process flow to another process flow (sub process) in warehouse builder? let me know the steps I have to do in warehouse builder.
    Thanks in advance,
    Kishan

    Hi Kishan,
    Please post this question to the Warehouse Builder forum:
    Warehouse Builder
    Thanks, Mark

  • How can you configure mail settings in process chains?

    HI Experts,
    please let me know how can you configure mail settings in process chains?

    Dear Suman,
    To initiate the mails we first need to have SMTP connection. To check the same go to so00 and try sending mails to ur ID. If is successful it states that u have the SMTP access.
    To create mails to Process chains:
    Right Click on the Process varient select the Create Message in the context menu.
    Select the type of mail i.e for successful, Error, Anyways.
    Then follow the screens.
    Note: The recipient type should be Via Internet.
    Hope this helps u.
    Regards,
    Kishore.Pulla

  • How can i know the servlet is running or not?

    Hi all,
           I have a doubt regarding servlet. I created one servlet and deployed in server. Now i called (RUN) the servlet from the browser. And it is running. Now can i know that the servlet is running or not in the server without seeing in the browser. Can we know the status of the servlet with its URL in the server whether it is running or not?
             Let me explain my problem. In my servlet it will run continously read one table and  do some operation depending on the entries in that table. Now i called the servlet from the browser. After some time i closed the browser. If browser is there i can know whether servlet is running or not. But now how can i know that servlet is running or not. Becoz eventhough we closed the browser the servlet will run in the background. How can i achieve this?
    Thanks and Regards,
    VJR.

    Hi!
    With first call, the servlet will be loaded, and it remains so until server-shutdown, but you need a timer-mechanism execute method calls continuously.
    Regards,
    Thomas

  • How can we let the program run in backgroud automatically?

    normally,we need to find peak off time run big program
    that read pooled table and slowly.
    How can we let the program run in backgroud automatically?
    BTW:before that pop a window just give runner a notice.

    Here is an example, try this one.
    REPORT ztest.
    PARAMETERS: p_vbeln LIKE vbak-vbeln,
                p_bkrun NO-DISPLAY.
    DATA: ls_vbak LIKE vbak.
    DATA: v_answer,
          v_jobcount LIKE tbtcjob-jobcount.
      IF p_bkrun IS INITIAL.
    *-- not background processing
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
                  textline1      = 'This may time out.'
                  textline2      = 'Do you want to run in background?'
                  titel          = 'Warning!!!'
                  cancel_display = space
             IMPORTING
                  answer         = v_answer.
        IF v_answer = 'J'.
    *-- run in the background
          CALL FUNCTION 'JOB_OPEN'
               EXPORTING
                    jobname          = 'ZTEST'
               IMPORTING
                    jobcount         = v_jobcount
               EXCEPTIONS
                    cant_create_job  = 1
                    invalid_job_data = 2
                    jobname_missing  = 3
                    OTHERS           = 4.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            EXIT.
          ENDIF.
    *-- submit the program in the background
          SUBMIT ztest
            WITH p_bkrun = 'X'
            WITH p_vbeln = p_vbeln
            USER sy-uname
            VIA JOB 'ZTEST' NUMBER v_jobcount AND RETURN.
    *-- close the job
          CALL FUNCTION 'JOB_CLOSE'
               EXPORTING
                    jobcount             = v_jobcount
                    jobname              = 'ZTEST'
                    strtimmed            = 'X'
               EXCEPTIONS
                    cant_start_immediate = 1
                    invalid_startdate    = 2
                    jobname_missing      = 3
                    job_close_failed     = 4
                    job_nosteps          = 5
                    job_notex            = 6
                    lock_failed          = 7
                    OTHERS               = 8.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          EXIT.
        ELSE.
          CLEAR v_answer.
        ENDIF.
      ENDIF.
      CHECK v_answer IS INITIAL.
      SELECT SINGLE * FROM vbak
                      INTO ls_vbak
                     WHERE vbeln = p_vbeln.
      IF sy-subrc <> 0.
        WRITE:/ 'Invalid Order Id.'.
      ENDIF.
    END-OF-SELECTION.
      CHECK v_answer IS INITIAL.
      IF p_bkrun IS INITIAL.
        WRITE:/ 'Here is the result running the program in foreground.'.
      ELSE.
        WRITE:/ 'Here is the result running the program in background.'.
      ENDIF.
      WRITE:/ ls_vbak-vbeln,
              ls_vbak-vkorg.

  • How can i know if the sync process is done after a bookmark adding or so such and when it is processing , immediately after changes or what?

    how can i know if the sync process is done after a bookmark adding or so such and when it is processing , immediately after changes or what?

    I don't know whether you solve your problem or not! Anyway, I have the same problem. The program hangs when getInputStream is called.
    DataInputStream dis = new DataInputStream(request.getInputStream());
    If you have the answer, please let me know. Thanks!!

  • HOW CAN I GET MY CHANGE IN PROCESSING(got it)?

    Hi all....
       please understand my requiement and get back with your valueble answers...
    iam having one table control in one of my screen....
    in that....table control it contains three fields.... so as we know three columns...
    middle column is for second field...
      here i am changing first entry ( 1st row of second column) manually... and clicking one push button of my screen to do some caluclation part combine with table control entries...
    ex: table controls looks like.....(before)
         1   100 ab
         2   200 gh
         3   300 vf
         4   400 fh
         .. .... ......  etc
    now manual i changed above like....(after)
         1   150 ab       <------ only change
         2   200 gh
         3   300 vf
         4   400 fh
         .. .... ......  etc
    So... here my problem is iam getting my caluculation part with that field as 100 only.... not as 150,
    even i debug this variable with defferent conditions like......
       READ TABLE ITAB WHERE ITAB-F1 = 1.
    SO HOW CAN I GET MY CHANGE IN PROCESSING? WHERE I HAV TO MODIFY MY PROGRAM?
    (edited: prevoius ly this value is capturing correctly...because that calculation part is in the module which is added between chain and endchain)
    Expect Max marks,
    Thanks,
    Naveen
    Edited by: Naveen Inuganti on May 27, 2008 11:57 AM
    dont worry guys i got the answer.... we have to catch that varible in the chain and endchain operater.... by using module.....
    thank you all...
    bye...
    Edited by: Naveen Inuganti on May 27, 2008 3:41 PM
    Edited by: Naveen Inuganti on May 27, 2008 4:00 PM
    Edited by: Naveen Inuganti on Jun 13, 2008 11:44 AM

    Hi,
    I think f2 is a key field in table.So 150 considered as new entry.this case you have to keep 100 for delete from table then add 150 entry.i think you are getting update in itab.But not in table.If you  are not getting itab, post your code to check

  • How can I let i pad memorize a certain minute in an mp3 educational series?

    how can I let i pad memorize a certain minute in an mp3 educational series?
    I am listening to an educational Audio mp3 files on my i Pad, I find difficulties to go back to last certain minute I reached in my listening especially when I connect the I pad to my computed the Audio player will loss the certain minute I reached and will lead me back to the last opened file only. Also if I will open a video I will lose even the last memorized audio file in my i Pad player.
    Thanks& Regards.

    Thank You so much for your answer,
    Actually I am listening through the music player in my iPad named (iPod) the original one from Apple.
    Note:
    All my Educational mp3 files are installed on my iPad.
    I just ask if there is a way or a program to save where I reached in each playlist. I realized that this is not possible in the normal original music player in my iPad.
    The great program iBook will memorize the last page you opened for each book, even if you have 1000 book, so if you open the book later iBook will lead you to the last opened page for each book, I would like to find a program to do the same by memorizing what I listened to in each playlist in my Audio Library to lead me to a certain minute in the last opened file in each one.
    This is very important for us, your suggests and support is highly appreciated.
    Thanks & Regards

  • When I add a date to a cell, how can I let another cell display a date that is 30 days later?

    when I add a date to a cell, how can I let another cell display a date that is 30 days later?

    =[cell reference] +30

  • How can i let a move clip complete his motion tween movement after dragging and dropping it

    hi how can i let a move clip complete his motion tween movement after dragging and dropping it
    i am using this code and there is a motion tween applies to the movie clip r_mc
    r_mc.addEventListener(MouseEvent.MOUSE_DOWN,fun); r_mc.addEventListener(MouseEvent.MOUSE_UP,fun2); function fun(event:MouseEvent):void { stop(); r_mc.startDrag();
    function fun2(event:MouseEvent):void {
    play(); r_mc.stopDrag();

    i have a simple .fla file wich contains MC that has
    a motion tween(its moving from the left to the right of the stage)
    this motion tween covers the whole time line (  there is only 50 frames in the time line)
    i mean in the frame 1 the MC appears in the left of the stage
    and in the frame 50 the MC appears in the right of the stage and there is a motion tween between them
    every thing till now working well
    i want to make that MC dragabble
    so when i drag the MC i will use stop()
    and when i drop it i will use play()
    but the problem is that the mc doesnt move and complete
    his motion tween movement when i drop it
    for example the MC will be in the middle of the stage in frame 25
    in this frame (25) i am draging the MC ,stoping the timeline,dropping the MC and resum playing the timeline again
    but the MC freezes in the middle of the stage and doesnt go to the right of the stageo until the flash loops and start from the frame 1 again
    here is the example wich i am worikng on
    http://www.mediafire.com/?ia47r4owha7sz8v
    thank u very much and sorry for my bad English

  • How can i let my java application closes the other opened windows

    how can i let my java application closes the other opened windows: like any other Microsoft Internet Explorer windows ... provided that my java application is not the one i used to open those other windows.... thanks in advance

    you'll have to use JNI to access the windowAPI
    then you need a list of window handles ... I think there was a function called getWindow and in order to close them you use sendMessage .... for details check out msdn (microsoft developer network)
    somwhere I saw a tool called JUtil, which might help you getting started on accessing the win api from java
    regards
    Spieler

  • How can I automate the multi-step process of looking up a caller's contact details when a telephone call comes in with caller ID?

    How can I automate the multi-step process of looking up a caller's contact details when a telephone call comes in with caller ID. I want to be able to see more than just the first & last name when a client calls me. I would like the caller ID to pull up the same information that shows up when you search for and find a contact name and then click on the right arrow.
    My workaround is to force/enter both the last name and the address in the last name field since then the address will show up.
    The only computerized way to look up this additional information is to put the client on hold, memorize the first and last name and correctly enter it in the search field of the contact database and hopefully find it before the client gets tired of waiting.
    Note that I go to about 48 small jobs per week. So far I have about 9,000 contacts. It's easy to make a mistake and have the client wondering what I'm doing and what's taking so long.
    The second workaround is to use paper and pencil and ask the client for name, address, cross street and phone number again, repeating what I did some time previously.
    Please help meautomate this process.

    You don't have to put anyone on hold. When the call comes in, tap the Home button, then tap contacts, go to the contact. Tap Home button when finished, tap the top banner to return to the call screen.

  • How can I let my mac read an application as a known creator to keep on the security while using it?

    Hey , whats up?
    I bought my mac mini, I want to keep it safe from unknown creators and more and there is a great app that I'm using and the creator is not marked as a known one or downloaded from the app-store so how can I let my mac open this app while the blocking will be on the option "Allow apps only by known creators & App-Store apps" ?
    Thank you very much, Nadav.

    This is called the "Gatekeeper" function, more info here:
    http://support.apple.com/kb/HT5290
    Basically the developer can fix this by digitally signing their apps.  However you can exempt an app, in the article linked above look for the section titled "How to open an app from a unidentified developer and exempt it from Gatekeeper"

  • HT5622 I have no credit card.  How can I  complete apple id registration process without credit card details

    How can I complete apple id registration process without the credit card details?  I have no credit card and no
    intention to download applications with charges.  Thanks in advance.

    You can't complete without card, but you can take one out after complition.
    You can also create new one without it, but that would have to be different email using instructions here.
    Create iTunes Store account without credit card - Support - A

Maybe you are looking for

  • ITunes 10.2.2 no longer organizing library

    I have been adding video content to iTunes, and it was working normally. I've got "Keep iTunes Media folder organized" and "Copy files to iTunes Media folder when adding to" checked, and when I add the files, they moved into the iTunes Media folder.

  • Problem with the original iphone.

    i have the original iphone for the past year and half. i've dropped it many times, but it didn't harm the iphone. the other day, i dropped it, and it died. it didn't respond to nothing. until i plugged it to the charger, and to the computer. than whe

  • Queary regarding Client Copy

    Hi Experts, I have a scenario where in my Source Systems runs on HP-UX,Oracle10G and ECC 6.0 and my Target Systems runs on Windows 2003,Oracle 10G and ECC 6.0 except OS all the SAP and DB versions and Patches are same. Could you please tell me can i

  • Master detail form

    Hi team, I am trying to create a Master detail form. I have two tables artist_master, pk group_code Artist_detail pk group_code. I have linked it as foreign key to Artist_master I have used the wizard to create the form. In the report page when I cli

  • Shortening URL help

    So I have searched for info on how to do this and have followed the steps: 1. Copy iWeb site to Folder 2. Upload just the files from the "My Site" folder to FTP site for hosting 3. Site should be www.url.com/MySite My site is hosted on GoDaddy. I hav