JACOB's Unicode Compatibility

I tried to insert or replace text with a Unicode character, say, "\u0111", into Word using JACOB (http://danadler.com/jacob ), but it would only show "?" for that; as a matter of fact, it displays "?" for all characters beyond the ANSI range \u0000-\u00FF. It seems that something is missing when JACOB communicates with COM. Word itself can handle Unicode characters without problem.
How can I make JACOB Unicode compatible? Is there a workaround this shortcoming? Thanks.
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.*;
import java.io.*;
public class Word
     private ActiveXComponent wordApp;
     private Object aDoc;
     private Object selectionObj;
     private Object findObj;
     public Word()
          wordApp = new ActiveXComponent("Word.Application");
          wordApp.setProperty("Visible", new Variant(true));
     public void open(String docName)
          Object documents = wordApp.getProperty("Documents").toDispatch();
          aDoc = Dispatch.call(documents, "Open", docName).toDispatch();
          selectionObj = wordApp.getProperty("Selection").toDispatch();
          findObj = Dispatch.call(selectionObj, "Find").toDispatch();
     public void replaceAll(String source, String target) throws java.lang.InterruptedException
          Variant True = new Variant(true);
          Variant False = new Variant(false);
          Dispatch.call(findObj, "ClearFormatting");
          Object replacementObj = Dispatch.call(findObj, "Replacement").toDispatch();
          Dispatch.call(replacementObj, "ClearFormatting");
          Variant FindText = new Variant(source);
          Variant ReplaceWith = new Variant(target);
          Variant Format = False;
          Variant MatchCase = True;
          Variant MatchWholeWord = False;
          Variant MatchWildcards = False;
          Variant MatchSoundsLike = False;
          Variant MatchAllWordForms = False;
          Variant Forward = True;
          final int WdFindWrap_wdFindContinue = 1;
          Variant Wrap = new Variant(WdFindWrap_wdFindContinue);
          final int WdReplace_wdReplaceAll = 2;
          Variant Replace = new Variant(WdReplace_wdReplaceAll);
//          Find.Execute(ref FindText, ref MatchCase, ref MatchWholeWord, ref MatchWildcards,
//                         ref MatchSoundsLike, ref MatchAllWordForms, ref Forward, ref Wrap,
//                         ref Format, ref ReplaceWith, ref Replace);     
          Dispatch.callN(findObj, "Execute", new Variant[] {
                         FindText, MatchCase, MatchWholeWord, MatchWildcards,
                         MatchSoundsLike, MatchAllWordForms, Forward, Wrap,
                         Format, ReplaceWith, Replace} );
          Dispatch.call(selectionObj, "WholeStory");
          Object font = Dispatch.call(selectionObj, "Font").toDispatch();
          Dispatch.put(font, "Name", "Arial");
     public void close()
          File outdir = new File("c:\\temp_Unicode");
          if (!outdir.exists())
               outdir.mkdir();
          Dispatch.call(wordApp, "ChangeFileOpenDirectory", outdir.getAbsolutePath());
          Dispatch.call(aDoc, "SaveAs", "out.doc");
          Dispatch.call(aDoc, "Close", new Variant(false));
          wordApp.invoke("Quit", new Variant[] {});
     public static void main(String[] args) throws java.lang.InterruptedException
          Word test = new Word();
          test.open("c:\\temp\\test.doc");
          Thread.sleep(1500);
          test.replaceAll("a", "\u0111");
          Thread.sleep(1500);
          test.close();
}

hi can any one tell me how the change the size of the window,I use resize it works but for the first time when the window is in Maximum its gives me Window is Maximum error.but after manually when i resize it it works fine.
I am pasting my code Plz help me
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.*;
import java.io.*;
public class Word1 implements Serializable
     public ActiveXComponent wordApp;
     private Object aDoc;
     private Object selectionObj;
     private Object findObj;
     private Object closeObj;
     private Object font;
     private String docContect;
     public Word1()
     public ActiveXComponent open(String docName) throws java.lang.InterruptedException
     wordApp = new ActiveXComponent("Word.Application");
          wordApp.setProperty("Visible", new Variant(true));
          final int a = 0;
          Variant ReplaceWindow = new Variant(a);
          //Dispatch.call(wordApp,"WindowState",a);
          Dispatch.callN(wordApp,"WindowState",new Variant[] {ReplaceWindow});
          Variant va = Dispatch.call(wordApp,"WindowState");
          System.out.println(" VAlue :"+ va.toInt());
          //Dispatch.call(testdocuments,"wdWindowStateNormal");
          try {
          Dispatch.call(wordApp,"Resize",new Integer(450),new Integer(300));
          catch( com.jacob.com.ComFailException ce) {
          System.out.println(ce);
          //int a =1;
          //Object testdocuments = Dispatch.call(wordApp,a,"wdWindowStateNormal").toDispatch();
          //Dispatch.call(wordApp,"NormalTemplate");
          //System.out.println("testdocuments :" +testdocuments);
          //Dispatch.call(testdocuments,"wdWindowStateNormal");
          ////Object documents = wordApp.getProperty("Documents").toDispatch();
          ////aDoc = Dispatch.call(documents, "Open", docName).toDispatch();
          return wordApp;
     public String findString(String source) throws java.lang.InterruptedException
     // Initialize the starting position to zero
          int position = 0;
          int position1 = 0;
          int arrayCount = 0;
          String firstSource;
          String middleSource;
          String lastSource;
          String findPosition = "";
          firstSource = source + " ";
          middleSource = " " + source + " ";
          lastSource = " " + source;
          Object activeDoc = wordApp.getProperty("ActiveDocument").toDispatch();
          docContect = Dispatch.call(activeDoc, "Content").toString();
          selectionObj = wordApp.getProperty("Selection").toDispatch();
          findObj = Dispatch.call(selectionObj, "Find").toDispatch();
          Variant True = new Variant(true);
          Variant False = new Variant(false);
          Dispatch.call(findObj, "ClearFormatting");
          Object replacementObj = Dispatch.call(findObj, "Replacement").toDispatch();
          Dispatch.call(replacementObj, "ClearFormatting");
          String target = "to";
          Variant FindText = new Variant(source);
          Variant ReplaceWith = new Variant(target);
          Variant Format = False;
          Variant MatchCase = True;
          Variant MatchWholeWord = True;
          Variant MatchWildcards = False;
          Variant MatchSoundsLike = False;
          Variant MatchAllWordForms = False;
          Variant Forward = True;
          final int WdFindWrap_wdFindContinue = 1;
          Variant Wrap = new Variant(WdFindWrap_wdFindContinue);
          final int WdReplace_wdReplaceAll = 2;
          Variant Replace = new Variant(WdReplace_wdReplaceAll);
          Object content = Dispatch.call(activeDoc,"Content").toDispatch();
          Object char1 = Dispatch.call(content,"Characters").toDispatch();
          Variant vwordcount = Dispatch.call(char1,"Count");
          int wordcount = vwordcount.toInt();
          String[] strArray = docContect.split(" ");
          //System.out.println("docContect :" + docContect);
          for(int i=0;i<wordcount;i++) {                 
          position = docContect.indexOf(firstSource,position1);
          if(position == 0 || position == -1)
          position = docContect.indexOf(middleSource,position1);
          if(position == 0 || position == -1) {
          position = docContect.indexOf(lastSource,position1);
          if(position == 0 || position == -1) {
          position = docContect.indexOf(source,position1);
          if(position == 0 || position == -1) {
          //System.out.println("position :" + position);
          break;
          //findPosition = position+"#";
          position1 = position + 1;
          i = position;
          //System.out.println("String Location :" + position1);
          Object item = Dispatch.call(char1,"Item",new Integer(position1)).toDispatch();
          Dispatch.call(item,"Select");
          Thread.sleep(1000);
     return findPosition;                                             
     public void gotoPosition(int num) {
     Object activeDoc = wordApp.getProperty("ActiveDocument").toDispatch();
Object content = Dispatch.call(activeDoc,"Content").toDispatch();
     Object char1 = Dispatch.call(content,"Characters").toDispatch();
Object item = Dispatch.call(char1,"Item",new Integer(num)).toDispatch();
     Dispatch.call(item,"Select");
     public void close() {
wordApp.setProperty("Visible", new Variant(false));

Similar Messages

  • FB03 - Short Dump - is not Unicode-compatable

    hi gurus,
    i have a short dump in PRODUCTION in TCODE : FB03.
    the short dump says that  syntax error in program : RK2RS001 is not UNICODE-COMPATABLE in program attributes...
    how can i resolve this one pls...
    thanks in advance,
    pasala.

    Hi,
    Refer to below links:
    <<links removed, points unassigned by moderator>>
    Regards,
    Prasuna.
    Edited by: kishan P on Nov 24, 2010 2:03 PM

  • Unicode Compatability is a pre requisite for ECC 6.0

    Hi all,
    Can any body send me any link or any document which says tht Unicode Compatability is a pre requisite for ECC 6.0. its really urgent.
    Regrads,
    Ruchika saini

    Hi
    see this
    The Link will be helpful to you.
    Re: Upgrade 4.6 to ECC - What are the responsibilites
    regarding Unicode influence in Standard programs
    Very good document:
    http://www.doag.org/pub/docs/sig/sap/2004-03/Buhlinger_Maxi_Version.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d37d1ad9-0b01-0010-ed9f-bc3222312dd8
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/589d18d9-0b01-0010-ac8a-8a22852061a2
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f8e316d9-0b01-0010-8e95-829a58c1511a
    You need to use the transaction UCCHECK.
    The report documentation is here
    ABAP Unicode Scan Tool UCCHECK
    You can use transaction UCCHECK to examine a Unicode program set for syntax errors without having to set the program attribute "Unicode checks active" for every individual program. From the list of Unicode syntax errors, you can go directly to the affected programs and remove the errors. It is also possible to automatically create transport requests and set the Unicode program attribute for a program set.
    Some application-specific checks, which draw your attention to program points that are not Unicode-compatible, are also integrated.
    Selection of Objects:
    The program objects can be selected according to object name, object type, author (TADIR), package, and original system. For the Unicode syntax check, only object types for which an independent syntax check can be carried out are appropriate. The following object types are possibilities:
    PROG Report
    CLAS Class
    FUGR Function groups
    FUGX Function group (with customer include, customer area)
    FUGS Function group (with customer include, SAP area)
    LDBA Logical Database
    CNTX Context
    TYPE Type pool
    INTF Interface
    Only Examine Programs with Non-Activated Unicode Flag
    By default, the system only displays program objects that have not yet set the Unicode attribute. If you want to use UCCHECK to process program objects that have already set the attribute, you can deactivate this option.
    Only Objects with TADIR Entry
    By default, the system only displays program objects with a TADIR entry. If you want to examine programs that don't have a TADIR entry, for example locally generated programs without a package, you can deactivate this option.
    Exclude Packages $*
    By default, the system does not display program objects that are in a local, non-transportable package. If you want to examine programs that are in such a package, you can deactivate this option.
    Display Modified SAP Programs Also
    By default, SAP programs are not checked in customer systems. If you also want to check SAP programs that were modified in a customer system (see transaction SE95), you can activate this option.
    Maximum Number of Programs:
    To avoid timeouts or unexpectedly long waiting times, the maximum number of program objects is preset to 50. If you want to examine more objects, you must increase the maximum number or run a SAMT scan (general program set processing). The latter also has the advantage that the data is stored persistently. Proceed as follows:
    - Call transaction SAMT
    - Create task with program RSUNISCAN_FINAL, subroutine SAMT_SEARCH
    For further information refer to documentation for transaction SAMT.
    Displaying Points that Cannot Be Analyzed Statically
    If you choose this option, you get an overview of the program points, where a static check for Unicode syntax errors is not possible. This can be the case if, for example, parameters or field symbols are not typed or you are accessing a field or structure with variable length/offset. At these points the system only tests at runtime whether the code is sufficient for the stricter Unicode tests. If possible, you should assign types to the variables used, otherwise you must check runtime behavior after the Unicode attribute has been set.
    To be able to differentiate between your own and foreign code (for example when using standard includes or generated includes), there is a selection option for the includes to be displayed. By default, the system excludes the standard includes of the view maintenance LSVIM* from the display, because they cause a large number of messages that are not relevant for the Unicode conversion. It is recommended that you also exclude the generated function group-specific includes of the view maintenance (usually L<function group name>F00 and L<function group name>I00) from the display.
    Similarly to the process in the extended syntax check, you can hide the warning using the pseudo comment ("#EC *).
    Applikation-Specific Checks
    These checks indicate program points that represent a public interface but are not Unicode-compatible. Under Unicode, the corresponding interfaces change according to the referenced documentation and must be adapted appropriately.
    View Maintenance
    Parts of the view maintenance generated in older releases are not Unicode-compatible. The relevant parts can be regenerated with a service report.
    UPLOAD/DOWNLOAD
    The function modules UPLOAD, DOWNLOAD or WS_UPLOAD and WS_DOWNLOAD are obsolete and cannot run under Unicode. Refer to the documentation for these modules to find out which routines serve as replacements.
    Regards
    Anji

  • Checking Unicode Compatibility of a class

    Hi All,
      There is an ABAP Class in XI which converts Idoc XML to Idoc Flat file structure. I just want to know how can we check whether this ABAP Class in Unicode Compatible or not?
    Regards,
    Dinakar

    Hi a®s,
      The problem is
      Idoc which contains chinese characters is triggered from R/3 to XI.It comes to XI as it is supposed to(with chinese characters). In XI there is an ABAP Class written which converts Idoc to Idoc flat file Structure provided by SAP and is in the below link.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    After this class(ABAP Mapping in terms of XI) is executed chinese characters are replaced with #. So what could be the problem. Any idea on this?
    Regards,
    Dinakar

  • Unicode compatibility check of object types(swo1)

    Dear all,
    Where and how we can maintain unicode checks active for  object types(swo1).
    Please help me.
    Thanks nad regards,

    Hello all,
    this question has been answered:
    Look at the forum post started by Jorge Alonso "Unicode and object type"
    Regards
    Bertram

  • Regarding Unicode compatibility for Interfaces

    Hi,
    I was just trying to understand if the interfaces developed in SAP ECC 6.0 are unicode compatible.These are IDOCS that are extended.How should i check?  Kindly advice.
    Thanks
    Pradeep.

    Hi Pradeep,
    in general in a Unicode conversion project, you need to test all your interfaces.
    Rather critical cases are Unicode <> MDMP and Unicode <> Double-Byte languages.
    Less critical is Unicode <> Unicode.
    However in all cases you need to test your scenarios.
    Please also have a look at
    http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000380759&_OBJECT=011000358700000061542011E
    Best regards,
    Nils Buerckel
    SAP AG

  • Unicode compatibility??

    i have to develop a program in java which should print the characters corresponding to the unicode enter into it.
    I have checked and have found that my java only support ASCII codes.
    So what should i do to make my java unicode compatible?Plz do answer it.

    I have checked and have found that my java only
    support ASCII codes.No, this is not the case.
    If you mean that you're going to enter a number and get the unicode character whose value is that number, then simply casting the int to a char will work.
    int uni = 182;
    char ch = (char)uni;
    System.out.println(uni);
    System.out.println(ch);
    182
    ?

  • Unicode Compatability

    Hi Experts,
      sorry i hope routine question but please help me, I'm currently working on ECC6- my programmes must me unicode check at attributes or else I'm getting an error.
    But now i had a problem.....one of mu structure was declared as
    TYPES : t_outtab(1200).
    DATA  : gt_outtab TYPE TABLE OF t_outtab.
    and other
    DATA : g_detail02   TYPE yhr_ext_2.
    DATA : gt_detail02  LIKE yhr_ext_2 OCCURS 0 WITH HEADER LINE.
    but  yhr_ext_2  has 5 fields consisting of type P.
    so later in programme we are using
    gt_outtab[] = gt_detail02[].
    and when try to activate i was getting error
    "GT_OUTTAB" and "GT_DETAIL02" are not mutually convertible in a Unicode
    program.
    Like this my program was using 26 yhr structures , so out of them 7 structures contain Type P fields.
    so can any one please give me the best way to rectify the error.
    Thanks in advance..
    K.

    Hello Bablu,
    You have defined GT_OUTTAB as table w/o header line and you are trying to use it like header line. Hence the issue.
    TYPES : T_OUTTAB(1200).
    DATA : GT_OUTTAB TYPE TABLE OF T_OUTTAB WITH HEADER LINE.
    DATA : GT_DETAIL02 LIKE PA0001 OCCURS 0 WITH HEADER LINE. "Just for demonstration purposes
    LOOP AT GT_DETAIL02.
      GT_OUTTAB+0(8) = GT_DETAIL02-PERNR.
    ENDLOOP.
    Please change & then try again.
    BR,
    Suhas
    PS: I will not comment on the performance of the code though.

  • Import DLL with unicode in Labview

    Hi all,
    i am developing a software user-friendly to control a home-made microscope. I would like to install a Andor camera and to control it i have to import the dll of Andor SDK v3 but Labview cannot see any function from the header file because of a Unicode compatibility with LAbview (apparently Labview cannot read Unicode from the dll). Do you have any idea how to solve my problem ?
    thanks
    regards
    Philippe

    The problem you are having is a limitation with the Import Wizard. You should be able to configure the Call Library Function Node manually. As for Unicode support in general, you should read this article: http://decibel.ni.com/content/docs/DOC-10153

  • Code should be enhanced until it is unicode enabled?

    Hi,
    I did a test of the unicode compatibility of the user-exits. And I get the following error:
    Part of function group SAPLXKAEP see LXKAEPTAP need to be enhanced.
    There is 1 marked program or include file, which are used together with original SAP code which is already unicode-enabled. Because of that, your code should be enhanced, until it is unicode-enabled too.
    What does this mean? What should I do?

    I had done one Upgrade project where Organization decided to keep their SAP system Non-unicode. But from ECC5 onward, by default SAP std function groups are "Unicode enable checkbox" checked.
    Since function group is unicode enabled, all includes should be unicode compatible.
    I think this msg is mentioning that. have you checked the include for unicode compatibility ?

  • Regenerate decision tree for transfering to unicode system.

    Hello,
    We upgraded the system to a unicode system and we're getting runtime errors using PB infotypes (pb20/pb30) for the
    generated forums in the decision tree.
    The error thrown is unicode compatability, If I make a "false" change in a certain decision tree for a field, the form is regenerated and It works.
    The problem is , that I have over 200 fields for decision trees, and I need them all regenerated.
    Someone gave me report "RPUMKG00" as a solution (activation type 1), but It does not regenerate the forms in a unicode mode.
    does anybody have any ideas?
    thanks.

    Hello,
    We upgraded the system to a unicode system and we're getting runtime errors using PB infotypes (pb20/pb30) for the
    generated forums in the decision tree.
    The error thrown is unicode compatability, If I make a "false" change in a certain decision tree for a field, the form is regenerated and It works.
    The problem is , that I have over 200 fields for decision trees, and I need them all regenerated.
    Someone gave me report "RPUMKG00" as a solution (activation type 1), but It does not regenerate the forms in a unicode mode.
    does anybody have any ideas?
    thanks.

  • Working on Upgrade - Need to Activate all user exits for unicode

    Hi Experts,
    I am working for Upgrade project, All the user exits were not unicode compatable, Hence every T.Code which is activated for User Exit is going into Dumps.
    Can anyone give us the easy way to fix this problem.
    Regards,
    Sekhar.J

    Hey,
    Run the transaction UCCHECK with the relevant criteria..
    This will give you all the errors for unicode checks...Then you can try to fix them
    Reward if useful
    Regards
    Shiva

  • Unicode upgrade of ABAP code question.

    Hi gurus......
    I am involved in upgradation tool...
    when we are upgrading ec4 to ec6 some pgms are unicode compatable and we will get errors according to unicode format
    so when we get those errors can we replace those stmts by our code
    for eg.
    data fld(6)
           ln(8).
    describe filed fld length ln.
    should be replaced by
    describe filed fld length ln in characer mode
    like these can we change pgm according to unicode standards.
    thanks pls suggest me.
    Edited by: suma chandra on Dec 12, 2008 9:43 AM
    Edited by: Julius Bussche on Dec 12, 2008 10:01 AM

    >
    suma chandra wrote:
    > Hi we can update the custom pgms with uniocode standards
    >
    > but hw it can be done we need to know.........
    Hi suma,
    To make custom programs with unicode standards,
    first step--> goto program attributes, then activate "Unicode checks active" checkbox.
    second step--> use "UCCHECK" transaction, give your custom program name, it will displays all unicode errors and obsolete function modules(upload,download).
    third step--> its more adviceble to use this transaction eventhough u fixed all errors in second step, use "SLIN" transaction, give your program name and execute, it will displays all type of errors and warnings related to that program. As per the client's scope fix the errors and warning.
    I worked for over 14 upgrade projects. The above process is the standard process followed by SAP.
    Still you are looking for any information related to upgrade please feel free to contact me.
    Regards
    Arani Bhaskar
    Edited by: arani bhaskar on Feb 16, 2009 10:10 AM

  • Is the PRST2HBC Unicode compatible?

    Hello everybody,
    I would be very greatful for your advice; I am wondering if the PRST2HBC is Unicode compatible; I am studying on line and would like to get away from the computer a little, so mainly for pdf's; however i will be reading Sanskrit and as such, need Unicode compatibility.
    Thank you for your advice ...
    Kind regards.
    Iain Hill
    Solved!
    Go to Solution.

    Yes, this Reader is Unicode (UTF-8) compatible.
    The browser of the Reader supports the following encodings:
    Latin-1 (ISO-8859-1)
    Unicode (UTF-8)
    If my post answers your question, please mark it as an "Accepted Solution."

  • Help required for unicode compatibilty

    Dear All,
    We are in a process of analyzing the impact of unicode compatibility for our environment.
    Following is our scenario:
    - ECC6.0 is non unicode systsem
    - Need to buid unicode CRM 7, SCM 7, PI 7.1 and BI7
    - Need to integrate the above systems to non unicode ECC system.
    Our questions are :
    1. Is there any performance consideration when using communication between an Unicode and non-Unicode system?
       Is Unicode - Unicode faster than Unicode - non-Unicode communication performance wise?
    2. Do we face any  technical or functinal problems while trying to integrate
       unicode BI/ NW Java Stack  to non unicode systems.
    3. Do we need to review our sizing estimations due to unicode implemenation?
    5. what will be the storage consumption increase for unicode systems compared to non unicode?
    It would be greatly helpful for me if you can clarify these doubts.
    Thanks and Regards

    Hi,
    1. I think no one has really measured this. I expect a slightly higher requirement for Unicode <--> Non-Unicode interfaces.
    2. Please have a look at SAP Notes 838402, 73606, 975768 and 1358929 for restrictions in Non-Unicode systems. SAP highly recommends to go for Unicode in the whole landscape.
    3. and 5.  If you use the SAP quicksizer (http://service.sap.com/quicksizing), then Unicode is integrated.
    " Please note that the Quick Sizer results include Unicode requirements. For more
    information on additional requirements caused by Unicode, see
    http://service.sap.com/unicode -> Unicode Media Library -> Unicode information on
    specific topics: SAP Business Suite Unicode Hardware Requirements"
    Best regards,
    Nils Buerckel
    SAP AG

Maybe you are looking for