Passing a wchar_t* containing asian characters into java

I tried converting the wchar_t* into jstring in C, then passing that jstring into java, however, even though when I write the wchar_t* into a file, the asian characters read fine, the jstring in java becomes ????????????. Then I tried narrowing the wchar_t* into char*, then converting into jstring and passing that. Similarly, the char*, when written to a file, contains the proper asian characters, but when read in java, becomes ????????????.
Any help is appreciated!

ejp wrote:
Java strings contain UTF8.Java Strings contain UTF-16.True - I was thinking more of GetStringUTFChars when I said that.
A wchar is not even necessarily 8 bitsA wchar_t is necessarily at least 16 bits taking ISO/IEC 14882:1998 standard #3.9.1.5 into account.
Interesting - I will look that up. The following discussion would seem to disagree with that however.
[http://www.velocityreviews.com/forums/t289787-is-wchar_t-guaranteed-to-be-larger-than-char.html]

Similar Messages

  • Writing strings containing \0 characters into a TextField

    Hi,
    I have a string containing one or more '\0' characters. I need to write it into a TextField and, for the purpose, I use the setText method.
    What I get then is a substring containing only the characters before the first \0.
    If I use a JTextField then I am able to see all the characters but if I try to copy and paste the content of the JTextField (using CTRL-C and CTRL-V) I get again a substring terminated by the first \0.
    Could someone help me?

    Hello again,
    I wrote this program that will copy from one JTextField to another. are you trying to past to another application, if I past the string into ultraedit (text editor) I get the first word, I can't see a way around that?
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class SimpleApp extends JFrame {
    public static void main(String args[]) {
    SimpleApp aFrame = new SimpleApp();
    JTextField myTextField = new JTextField("one\0two\0three\0four\0");
    JTextField myTextField2 = new JTextField();
    public SimpleApp() {
    super("Frame");
    getContentPane().setLayout(new BorderLayout());
    setResizable(false);
    myTextField.setColumns(30);
    myTextField2.setColumns(30);
    getContentPane().add(myTextField, "Center");
    getContentPane().add(myTextField2, "South");
    pack();
    show();
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    }

  • How to find out whether the String contains chinese characters

    I need to check if the string contains chinese characters in Java. Does anyone know how to do it? thx.

    Since Java strings contain UNICODE code points, check the content against the relevant page here - http://www.unicode.org/charts/ .

  • Java class names which contain unicode characters

    I need to create, compile and load java classes which have class names that contain unicode characters.
    I am using Win2k but will neet to support unix* in future.
    When I try to create a fooXbar.jar where X is a unicode character which is not ascii I get an error when creating the file.
    My question is: how do I map java class names and package names which contain non ascii characters into
    names that the files systems will like AND that the java VM will use when trying to load .class file from the class path.
    for example what would the .java and .class file be for the following class?
    class \u6587\u66f8 {

    You could make names for .java and .class that is understandable by the filesystem. E.g. you could prepend with % and then digits for the unicode character. The problem is then how to compile the class, and how to load the class.
    You can load the class with a custom classloader, which will translate the unicode class name to the escaped file name (using %).
    The problem is then reduced to how you can compile your code (you have to map the file name to the class name somehow). I think it can be done, but I don't know the solution to that.
    Alternatively you can use meaningful names for the classes, and then make an obfuscator that can change the bytecodes so the classnames are changed to some obscure unicode names. Perhaps there is already obfuscators out there you can use that will use unicode characters.

  • Why does text on certain portions of websites, usually when adjacent text contains special characters, become jumbled into seemingly random sets of characters that are not in any way jumbled when viewing the source of the webpage? How can I fix this?

    When viewing most text on most websites, it displays properly. However, there are two instances where text will either tend to, or consistently, become jumbled into a mess of seemingly random characters. Oddly enough, these seemingly random characters are not, in fact, random. The same weird character will be used to replace the same regular English text character consistently across the entire area that has been jumbled.
    The two instances where this tends to occur most often, or consistently in some cases, are, first, when a paragraph or particular section of formatted text contains special characters, such as Chinese or Japanese characters, or accented letters. When this happens, usually the paragraph that contains the special characters is completely jumbled, while the rest of the text on the page will have intermittent jumbling on a word or two. Most often, the word "the" is jumbled in this case.
    The second instance where this happens is when a website uses specially formatted text in some form or another. I, not being an expert at web development, am not sure what kind of formatting causes it, but I can provide consistent examples in lieu of my experience:
    - Example 1:
    [http://img408.imageshack.us/img408/9564/firefoxcharencodingissu.jpg]
    Example 1 shows a portion of a screen-shot of the website "Joystiq.com". Every single article title on the front page of this blog is consistently jumbled, while the text of the article itself remains untouched. Please note that when this jumbled text is highlighted, it is visible un-jumbled in the right-click menu as well as in the source code of the page. Other consistent instances can be found within many search fields on various websites. For instance, the search bar located at the top right of "Kotaku.com" consistently displays jumbled characters both on its default text of "Search" and on any text that is typed into the search box itself.
    - Example 2:
    [http://img822.imageshack.us/img822/9564/firefoxcharencodingissu.jpg]
    Example 2 shows both the jumbling of the paragraph containing the character "☆" as well as the subsequent peppering of the rest of the article's text with small jumbled words. Below this is the DOM Source of the selected text which shows how the text itself is being rendered properly within the site's source. Additionally, for convenience, I have edited on to the bottom of the image a small snippet of what the search bar on the same page looks like. Notice how the grayed-out text that normally would read "Search" is instead jumbled.
    This issue has been plaguing my browser for the past year or so, and I had hoped that it would go away with subsequent Firefox updates. It has not gone away.
    Thank you for reading! Please help!

    This issue can be caused by an old bitmap version of the Helvetica or Geneva font or (bitmap) fonts that Firefox can't display in that size.
    Firefox can't display some old bitmap fonts in a larger size and displays gibberish instead.
    You can test that by zooming out (View > Zoom > Zoom Out, Ctrl -) to make the text smaller.
    Uninstall (remove) all variants of that not working font to make Firefox use another font or see if you can find a True type version that doesn't show the problem.
    There have also been fonts with a Chinese name reported that identify themselves as Helvetica, so check that as well.
    Use this test to see if the Helvetica font is causing it (Copy & Paste the code in the location bar and press Enter):
    <pre><nowiki>data:text/html,
    Helvetica<br><font face="Helvetica" size="25">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</font><br>
    Helvetica Neue<br><font face="Helvetica Neue" size="25">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</font>
    </nowiki></pre>
    You should reset the network.http prefs that show user set on the about:config page.<br />
    Not all websites support http pipelining and if they do not then you can have issues with images or other problems.
    See also http://kb.mozillazine.org/Images_or_animations_do_not_load#First_steps

  • Asian characters pop into text bubbles when I chat...

    Hi. I am having issues with iChat. When I type into the message field in iChat my text is in English. When I hit return, when the message is displayed into the bubbles, my text turns into Asian characters, which, of course, I am unable to read. However, the person that I am chatting with can see my words in English.
    I also notice that some headers (text headlines) on websites are displaying as fractional numbers and such as well. There must be something going on with my system that I just cannot pinpoint.
    Has anyone heard of this happening before? Please advise...
    Thanks.

    Go to Font Book and makes sure you do not have Helvetica Fractions Active.
    There are some other Fonts that cause similar issues so it may not be this one specifically.
    However this certainly should not be active for iChat.
    See also http://www.creativetechs.com/iq/garbledfonts_troubleshootingguide.html
    Thanks to Tom Geweke who posted this. (I hope I spelt his Name right)
    4:32 PM Sunday; December 2, 2007
    Message was edited by: Ralph Johns (UK)

  • Saving a file in a with a file name containing Japanese Characters

    Hi,
    I hope some genius out there comes up with the solution to this problem
    Here it is :
    I am trying to save some files using a java program from the command console , and the file name contains japanese characters. The file names are available to me as string values from an InputStream. When I try to write to a File Object containing the japanese characters , I get something like ?????.txt . I found out that I am able to save the files using the unicode value of the java characters.
    So I realize that the trick is to convert the streaming japanese characters , character by character into their respective unicode value and then Create A File Object with that name. The problem is -> I cant find any standard method to convert these characters into their unicode values. Does anyone have a better solution ? Remember , its not writing japanese characters to a file , but creating a file with japanese characters in the file name !!!!
    Regards
    Chandu

    retrive a byte array out of the input Stream and store the values in String using the condtructor
    String(byte [] bytes, String enc)
    where encoding would be Shift_Jis for japanese I guess.
    Now to understand this concept basically all the Strings are unicode however when you are passing a byte array String has no means to know what is the encoding of the byte array, which is being used to instantiate the String value so if no encoding is specified it takes the System value which is mostly iso-8859-1. This leads to displaying ?
    However in case you know the encoding of the array specifying that in the constructor would be a real help.

  • PL/SQL function to read a string of characters into an array

    I was wondering if there is an easier way than using the substr function multiple times. Here is the example:
    Suppose you have a varchar2 variable that contains the word 'Apple'. The function should take it and produce an array. We would invoke it like this:
    <what data structure?> a := stringunpackerfunction(x);
    // x is the varchar2 containing 'Apple'.
    The resulting a would be such that a[0] is 'A', a[1] is 'p', a[2] is 'p', a[3] is 'l' and a[4] is 'e'.
    If there is no direct function to do this in a single invocation, is there a function to simply read a string of characters and return 'the next character'?
    Thanks,
    Regards,
    Srini

    There is a procedure out there called PS_PARSE which takes a string and converts to an array provided with an identified separator. Works for us pretty well.
    I just grabbed this off of google. I am presuming this should work fine. It has been sometime since we implemented ours that I forget if there were any additional modifications that we made. I think there was one regarding the size of the string that could be handled. I forget precisely. Anyways... take a peek at it. Its makes things easy in that your logic is pretty streamlined.
    Barry C
    http://www.myoracleportal.com
    create or replace PACKAGE PS_Parse
    IS
         || PL/SQL table structures to hold atomics retrieved by parse_string.
         || This includes the table type definition, a table (though you can
         || declare your own as well, and an empty table, which you can use
         || to clear out your table which contains atomics.
         TYPE atoms_tabtype IS TABLE OF VARCHAR2(60) INDEX BY BINARY_INTEGER;
         atoms_table atoms_tabtype;
         empty_atoms_table atoms_tabtype;
         || The standard list of delimiters. You can over-ride these with
         || your own list when you call the procedures and functions below.
         || This list is a pretty standard set of delimiters, though.
         std_delimiters VARCHAR2 (50) := ' !@#$%^&*()-_=+\|`~{{]};:''",<.>/?';
         /* Display contents of table using DBMS_OUTPUT */
         PROCEDURE display_atomics
              (table_in IN atoms_tabtype, num_rows_in IN NUMBER);
         || The parse_string procedure: I provide two, overloaded definitions.
         || The first version puts all atomics into a PL/SQL table and would
         || be used in a PL/SQL Version 2 environment. The second version places
         || all atomics into a string, separating each atomic by a vertical bar.
         || (My code does NOT do any special handling when it finds a "|" in
         || the string. You have to deal with that when you extract the atomics.
         ||
         || See the program definition for more details on other parameters.
         PROCEDURE parse_string
              (string_in IN VARCHAR2,
              atomics_list_out OUT atoms_tabtype,
              num_atomics_out IN OUT NUMBER,
              delimiters_in IN VARCHAR2 := std_delimiters);
         PROCEDURE parse_string
              (string_in IN VARCHAR2,
              atomics_list_out IN OUT VARCHAR2,
              num_atomics_out IN OUT NUMBER,
              delimiters_in IN VARCHAR2 := std_delimiters);
         /* Count the number of atomics in a string */
         FUNCTION number_of_atomics
              (string_in IN VARCHAR2,
              count_type_in IN VARCHAR2 := 'ALL',
              delimiters_in IN VARCHAR2 := std_delimiters)
         RETURN INTEGER;
         /* Return the Nth atomic in the string */
         FUNCTION nth_atomic
              (string_in IN VARCHAR2,
              nth_in IN NUMBER,
              count_type_in IN VARCHAR2 := 'ALL',
              delimiters_in IN VARCHAR2 := std_delimiters)
         RETURN VARCHAR2;
    END PS_Parse;
    create or replace PACKAGE BODY PS_Parse
    IS
    /* Package variables used repeatedly throughout the body. */
    len_string     NUMBER;
    start_loc     NUMBER;
    next_loc     NUMBER;     
    || Since the PUT_LINE procedure regards a string of one or more
    || spaces as NULL, it will not display a space, which is in
    || PS_Parse a valid atomic. So I save a_blank in the PL/SQL
    || table instead of the space itself.
    a_blank CONSTANT VARCHAR2(3) := '" "';
    /*--------------------- Private Modules ---------------------------
    || The following functions are available only to other modules in
    || package. No user of PS_Parse can see or use these functions.
    FUNCTION a_delimiter
    (character_in IN VARCHAR2,
    delimiters_in IN VARCHAR2 := std_delimiters)
    RETURN BOOLEAN
    || Returns TRUE if the character passsed into the function is found
    || in the list of delimiters.
    IS
    BEGIN
    RETURN INSTR (delimiters_in, character_in) > 0;
    END;
    FUNCTION string_length (string_in IN VARCHAR2)
    RETURN INTEGER
    IS
    BEGIN
    RETURN LENGTH (LTRIM (RTRIM (string_in)));
    END;
    FUNCTION next_atom_loc
    (string_in IN VARCHAR2,
    start_loc_in IN NUMBER,
    scan_increment_in IN NUMBER := +1)      
    || The next_atom_loc function returns the location
    || in the string of the starting point of the next atomic (from the
    || start location). The function scans forward if scan_increment_in is
    || +1, otherwise it scans backwards through the string. Here is the
    || logic to determine when the next atomic starts:
    ||
    ||          1. If current atomic is a delimiter (if, that is, the character
    ||               at the start_loc_in of the string is a delimiter), then the
    ||               the next character starts the next atomic since all
    ||               delimiters are a single character in length.
    ||
    ||          2. If current atomic is a word (if, that is, the character
    ||               at the start_loc_in of the string is a delimiter), then the
    ||               next atomic starts at the next delimiter. Any letters or
    ||               numbers in between are part of the current atomic.
    ||
    || So I loop through the string a character at a time and apply these
    || tests. I also have to check for end of string. If I scan forward
    || the end of string comes when the SUBSTR which pulls out the next
    || character returns NULL. If I scan backward, then the end of the
    || string comes when the location is less than 0.
    RETURN NUMBER
    IS
    /* Boolean variable which uses private function to determine
    || if the current character is a delimiter or not.
    was_a_delimiter BOOLEAN :=
    PS_Parse.a_delimiter (SUBSTR (string_in, start_loc_in, 1));     
    /* If not a delimiter, then it was a word. */
    was_a_word BOOLEAN := NOT was_a_delimiter;
    /* The next character scanned in the string */
              next_char VARCHAR2(1);
    || The value returned by the function. This location is the start
    || of the next atomic found. Initialize it to next character,
    || forward or backward depending on increment.
    return_value NUMBER := start_loc_in + scan_increment_in;
    BEGIN
    LOOP
    -- Extract the next character.
    next_char := SUBSTR (string_in, return_value, 1);
    -- Exit the loop if:
    EXIT WHEN
    /* On a delimiter, since that is always an atomic */
    a_delimiter (next_char)
    OR
    /* Was a delimiter, but am now in a word. */
    (was_a_delimiter AND NOT a_delimiter (next_char))
    OR
    /* Reached end of string scanning forward. */
    next_char IS NULL
    OR
    /* Reached beginning of string scanning backward. */
    return_value < 0;
    /* Shift return_value to move the next character. */
    return_value := return_value + scan_increment_in;
    END LOOP;
    -- If the return_value is negative, return 0, else the return_value
    RETURN GREATEST (return_value, 0);
    END;
    PROCEDURE increment_counter
    (counter_inout IN OUT NUMBER,
    count_type_in IN VARCHAR2,
    atomic_in IN CHAR)
    || The increment_counter procedure is used by nth_atomic and
    || number_of_atomics to add to the count of of atomics. Since you
    || can request a count by ALL atomics, just the WORD atomics or
    || just the DELIMITER atomics. I use the a_delimiter function to
    || decide whether I should add to the counter. This is not a terribly
    || complex procedure. I bury this logic into a separate module,
    however,
    || to make it easier to read and debug the main body of the programs.
    IS
    BEGIN
    IF count_type_in = 'ALL' OR
    (count_type_in = 'WORD' AND NOT a_delimiter (atomic_in)) OR
    (count_type_in = 'DELIMITER' AND a_delimiter (atomic_in))
    THEN
    counter_inout := counter_inout + 1;
    END IF;
    END increment_counter;
    /* ------------------------- Public Modules -----------------------*/
    PROCEDURE display_atomics
    (table_in IN atoms_tabtype, num_rows_in IN NUMBER)
    || Program to dump out contents of table. Notice I must also pass in
    || the number of rows in the table so that I know when to stop the
    || loop. Otherwise I will raise a NO_DATA_FOUND exception. For a more
    || elaborate display_table module, see Chapter 7 on PL/SQL tables.
    IS
    BEGIN
    FOR table_row IN 1 .. num_rows_in
    LOOP
    DBMS_OUTPUT.PUT_LINE (NVL (table_in (table_row), 'NULL'));
    END LOOP;
    END;
    PROCEDURE parse_string
    (string_in IN VARCHAR2,
    atomics_list_out OUT atoms_tabtype,
    num_atomics_out IN OUT NUMBER,
    delimiters_in IN VARCHAR2 := std_delimiters)
    || Version of parse_string which stores the list of atomics
    || in a PL/SQL table.
    ||
    || Parameters:
    ||          string_in - the string to be parsed.
    ||          atomics_list_out - the table of atomics.
    ||          num_atomics_out - the number of atomics found.
    ||          delimiters_in - the set of delimiters used in parse.
    IS
    BEGIN
    /* Initialize variables. */
    num_atomics_out := 0;
    len_string := string_length (string_in);
    IF len_string IS NOT NULL
    THEN
    || Only scan the string if made of something more than blanks.
    || Start at first non-blank character. Remember: INSTR returns 0
    || if a space is not found. Stop scanning if at end of string.
    start_loc := LEAST (1, INSTR (string_in, ' ') + 1);
    WHILE start_loc <= len_string
    LOOP
    || Find the starting point of the NEXT atomic. Go ahead and
    || increment counter for the number of atomics. Then have to
    || actually pull out the atomic. Two cases to consider:
    ||          1. Last atomic goes to end of string.
    ||          2. The atomic is a single blank. Use special constant.
    ||          3. Anything else.
    next_loc := next_atom_loc (string_in, start_loc);
    num_atomics_out := num_atomics_out + 1;
    IF next_loc > len_string
    THEN
    -- Atomic is all characters right to the end of the string.
    atomics_list_out (num_atomics_out) :=
    SUBSTR (string_in, start_loc);
    ELSE
    || Internal atomic. If RTRIMs to NULL, have a blank
    || Use special-case string to stuff a " " in the table.
    atomics_list_out (num_atomics_out) :=
    NVL (RTRIM (SUBSTR (string_in,
    start_loc, next_loc-start_loc)),
                                       a_blank);
    END IF;
    -- Move starting point of scan for next atomic.
    start_loc := next_loc;
    END LOOP;
    END IF;
    END parse_string;
    PROCEDURE parse_string
    (string_in IN VARCHAR2,
    atomics_list_out IN OUT VARCHAR2,
    num_atomics_out IN OUT NUMBER,
    delimiters_in IN VARCHAR2 := std_delimiters)
    || The version of parse_string which writes the atomics out to a packed
    || list in the format "|A|,|C|". I do not repeat any of the comments
    || from the first iteration of parse_string.
    IS
    BEGIN
    /* Initialize variables */
    num_atomics_out := 0;
    atomics_list_out := NULL;
    len_string := string_length (string_in);
    IF len_string IS NOT NULL
    THEN
    start_loc := LEAST (1, INSTR (string_in, ' ') + 1);
    WHILE start_loc <= len_string
    LOOP
    next_loc := next_atom_loc (string_in, start_loc);
    num_atomics_out := num_atomics_out + 1;
    IF next_loc > len_string
    THEN
    atomics_list_out := atomics_list_out || '|' ||      
    SUBSTR (string_in, start_loc);
    ELSE
    atomics_list_out :=
    atomics_list_out || '|' ||      
    NVL (RTRIM (SUBSTR (string_in,
    start_loc, next_loc-start_loc)),
                                       a_blank);
    END IF;
    start_loc := next_loc;
    END LOOP;
    /* Apply terminating delimiter to the string. */
    atomics_list_out := atomics_list_out || '|' ;
    END IF;
    END parse_string;
    FUNCTION number_of_atomics
    (string_in IN VARCHAR2,
    count_type_in IN VARCHAR2 := 'ALL',
    delimiters_in IN VARCHAR2 := std_delimiters)
    RETURN INTEGER
    || Counts the number of atomics in the string_in. You can specify the
    || type of count you want: ALL for all atomics, WORD to count only the
    || words and DELIMITER to count only the delimiters. You can optionally
    || pass your own set of delimiters into the function.
    IS
    return_value INTEGER := 0;
    BEGIN
    /* Initialize variables. */
    len_string := string_length (string_in);
    IF len_string IS NOT NULL
    THEN
    || This loop is much simpler than parse_string. Call the
    || next_atom_loc to move to the next atomic and increment the
    || counter if appropriate. Everything complicated is shifted into
    || sub-programs so that you can read the program "top-down",
    || understand it layer by layer.
    start_loc := LEAST (1, INSTR (string_in, ' ') + 1);
    WHILE start_loc <= len_string
    LOOP
    increment_counter (return_value, UPPER (count_type_in),
    SUBSTR (string_in, start_loc, 1));
    start_loc := next_atom_loc (string_in, start_loc);
    END LOOP;
    END IF;
    RETURN return_value;
    END number_of_atomics;
    FUNCTION nth_atomic
    (string_in IN VARCHAR2,
    nth_in IN NUMBER,
    count_type_in IN VARCHAR2 := 'ALL',
    delimiters_in IN VARCHAR2 := std_delimiters)
    RETURN VARCHAR2
    || Find and return the nth atomic in a string. If nth_in is greater
    || the number of atomics, then return NULL. If nth_in is negative the
    || function counts from the back of the string. You can again request
    || a retrieval by ALL atomics, just the WORDs or just the DELIMITER.
    || So you can ask for the third atomic, or the second word from the end
    || of the string. You can pass your own list of delimiters as well.
    IS
    /* Local copy of string. Supports up to 1000 characters. */
    local_string VARCHAR2 (1000) :=
    LTRIM (RTRIM (SUBSTR (string_in, 1, 1000)));
    /* Running count of atomics so far counted. */
    atomic_count NUMBER := 1;
    /* Boolean variable which controls the looping logic. */
    still_scanning BOOLEAN :=
    local_string IS NOT NULL AND nth_in != 0;
    /* The amount by which I increment the counter. */
    scan_increment INTEGER;
    /* Return value of function, maximum length of 100 characters. */
    return_value VARCHAR2 (100):= NULL;
    BEGIN
    IF nth_in = 0
    THEN
    /* Not much to do here. Find 0th atomic? */
    RETURN NULL;
    ELSE
    /* Initialize the loop variables. */
    len_string := string_length (local_string);
    IF nth_in > 0
    THEN
    /* Start at first non-blank character and scan forward. */
    next_loc := 1;
    scan_increment := 1;
    ELSE
    /* Start at last non-blank character and scan backward. */
    next_loc := len_string;
    scan_increment := -1;
    END IF;
    /* Loop through the string until the Boolean is FALSE. */
    WHILE still_scanning
    LOOP
    /* Move start of scan in string to loc of last atomic. */
    start_loc := next_loc;
    /* Find the starting point of the next atomic. */
    next_loc      :=
    next_atom_loc (local_string, start_loc, scan_increment);
    /* Increment the count of atomics. */
    increment_counter
    (atomic_count,
    UPPER (count_type_in),
    SUBSTR (local_string, start_loc, 1));
    || Keep scanning if my count hasn't exceeded the request
    || and I am neither at the beginning nor end of the string.
    still_scanning :=
    atomic_count <= ABS (nth_in) AND
    next_loc <= len_string AND
    next_loc >= 1;
    END LOOP;
    || Done with the loop. If my count has not exceeded the requested
    || amount, then there weren't enough atomics in the string to
    || satisfy the request.
    IF atomic_count <= ABS (nth_in)
    THEN
    RETURN NULL;
    ELSE
    || I need to extract the atomic from the string. If scanning
    || forward, then I start at start_loc and SUBSTR forward.
    || If I am scanning backwards, I start at next_loc+1 (next_loc
    || is the starting point of the NEXT atomic and I want the
    || current one) and SUBSTR forward (when scanning in
    || reverse, next_loc comes before start_loc in the string.
    IF scan_increment = +1
    THEN
    RETURN
    SUBSTR (local_string, start_loc, next_loc - start_loc);
    ELSE
    RETURN
    SUBSTR (local_string, next_loc+1, start_loc - next_loc);
    END IF;
    END IF;
    END IF;
    END nth_atomic;
    END PS_Parse;
    /

  • Validation - template cannot contain escape characters

    Hi all, im new to Warehouse builder, i find the documentation lacking, the tutorials lacking and i can't find any books on warehouse builder either. Am I stupid ? :-)
    Anyway, i've set up 3 constants (varchar2) to pass as parameter values to a function im calling and when i try to validate the mapping im getting 'Template cannot contain escape characters'.
    Then im getting validation completed successfully..however, when i try to deploy im getting this:
    VLD-1141: Internal error during mapping generation.
    java.lang.IllegalArgumentException: Template cannot contain escape characters.
    at oracle.wh.util.expr.WBLiteralExpression.<init>(WBLiteralExpression.java:34)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.addContextExpressionsForGroups(GenericTransformGenerationDelegate.java:345)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.prepareOutputContextPlSql(GenericTransformGenerationDelegate.java:1433)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformPlSqlDelegate.prepareOutputContext(GenericTransformPlSqlDelegate.java:147)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:239)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoopInternal(PlSqlGenerationMediator.java:3206)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoop(PlSqlGenerationMediator.java:3190)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleRowBased(PlSqlGenerationMediator.java:3115)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assemble(PlSqlGenerationMediator.java:538)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:770)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:316)
    at oracle.wh.service.impl.mapping.generation.WBDeployableMappingGenerator.generate(WBDeployableMappingGenerator.java:99)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:433)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:311)
    at oracle.wh.service.impl.generation.service.WhValidationGenerationTransaction.run(WhValidationGenerationTransaction.java:241)
    I have no clue whatsoever what this is about, can anyone tell ?

    hi ,
    I also got the same error when i migrated MDL from owb 9.2 version.
    I was using OWB 10.2.01, and heard that it is a bug which is fixed in owb 10.2.0.3
    So i applied the patch and this error gone.
    In case if it help u.
    rojo

  • Convert Asian characters to EBCDIC double byte

    How can I convert Asian characters like Chinise or Japanese into EBCDIC double byte array in Java. Do any code available to do this
    Thanks

    If I have a asian character in test (String) need to
    convert it to double byte EBCDIC array. Can you please
    let me know how to convert.That is somewhat like saying how do you convert it to ASCII, neither is possible.
    There are a number of character sets in the world that use the EBCDIC encoding for the lower bytes and support a multibyte format for another language.
    First you need to figure out what character set(s) you can use.
    Second you see if java supports an encoding for that.
    If it does then you use String.getBytes(String charsetName)
    If it doesn't you will have to make your own mapping function.

  • Getting Data from C++ STL Vector into Java Vector

    Hi All,
    I have been involved in a project recently to port a lot of C++ code into Java. Testing the ported Java code has been done in isolation with JUnit and works fine, but we would like to test all the ported code. To do this we aim to call the ported (Java) methods from C++ using JNI.
    I have read a lot of the documentation from Sun on the JNI and can access and set Java methods that only contain primitive types without any problems. However what I cant seem to be able to achieve is passing aggregated C++ classes to Java.
    Java
    public void translation_unit_2( Vector v ) { \* code *\ }and somewhere in C++
    jobject actions;                  // Is initialized
    std::vector<Node> test ;   // Node class may contain other objects
    jmethodID tmp = env->GetMethodID(env->GetObjectClass(actions), "translation_unit_2", "(Ljava/util/Vector;)V");
    env->CallObjectMethod(actions, tmp, test);Now obviously what I have posted there doesnt work, but can anybody point me
    in the correct direction to pass the Vector and its Data in C++ to Java?
    None of the Java methods are native, because the eventually the whole system
    will be operating solely in Java, but the testing at this stage is quite important.
    If this is an impossible task then please say so also, any help will be appreciated !
    Thanks,
    Mark Hennessy

    Thanks for the reply and I understand that running an iterator
    over the vector would be the way the get the data out of the C++ Vector.
    However that still leaves me with the question of mapping an arbitrary
    C++ class ( which in the case of the example above would be a Node class which is
    composed of other aggregated classes ) to a jobject such that I can pass
    the data easily to Java throught JNI?
    Is this possible or would I have to decompose each and every class to its most
    primitive types and pass them over to Java and reconstruct them on the Java side?

  • How to insert & # special characters into oracle table?

    I have a text value which contains special characters such as & and #.
    After I pass from one page to another,
    TEST& becomes "TEST&amp;"
    I put " " on the above test, otherwise amp; will be truncated by OTN).
    TEST# becomes TEST (# is truncated).
    Actually the value is saved in table like this: "TEST&amp;"
    How to solve this problem?
    How to insert & into table without &amp;
    Thank you.
    Edited by: user628655 on Jul 27, 2009 9:47 AM
    Edited by: user628655 on Jul 27, 2009 9:49 AM
    Edited by: user628655 on Jul 27, 2009 10:39 AM

    Avoid doing that through a link. If this is a page item then submit the page and redirect to the target page using a branching. On the target page, create a computation to compute the target item using the original page item as the source. If you are talking about a report, use the id to pass through the link and fetch the text column in an on load computation.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Send email with Asian characters

    Hi
    Does anyone know how to send email with Asian characters? Sample code will be useful. I got ?? instead of the real characters, please help....
    Thanks in advance
    Ken

    Hello.
    How are you doing?
    Good Day.
    I think I have the concepts down some, I'm just gonna
    ask some questions for confirmation. First I'll list a
    statement then I'll as the question about the
    statement.
    If the statement is correct answer yes, on the other
    hand if the statement is false. Answer no to the
    question and explain.
    My purpose for asking you questions. Is to get a better understanding of JavaMail and to clear up any doubt. That, I may have on this subject that is related to the statements and questions.
    By having some one like you respond to my questions with answers.
    Here we go!
    The content of the Part Interface and Message class are not attributes at all.
    If this statement is correct or not correct please explian why.
    Is this statement correct?
    A DataHandler is the class called DataHandler and the
    object of the DataHandler class, which programmers
    would call the DataHandler object; which is (normally
    created by using the DataHandler class constructor). The DataHandler class, wraps the data into the DataHandler object which is called DataHandler; by you or I using the DataHandler class constructor.
    This statement is correct right?
    The DataHandler class takes the data you pass to it's
    constructor and wraps it into the DataHandler's object
    as one entity called an email message.
    Is this statement correct?
    Thanks in advance.
    Please email me as soon as possible;
    at [email protected]
    Peace out, have a good day.
    -Leroy

  • Slideshow: label with asian characters

    I just installed Fw CS3 french edition.
    When using the create sldeshow command from the menu I get 5
    tabs on the right side of the window.
    The last one appear with asian characters and a pop-up as
    well when clicking the create button.
    How to resolve it ?
    Best regards

    Hello.
    How are you doing?
    Good Day.
    I think I have the concepts down some, I'm just gonna
    ask some questions for confirmation. First I'll list a
    statement then I'll as the question about the
    statement.
    If the statement is correct answer yes, on the other
    hand if the statement is false. Answer no to the
    question and explain.
    My purpose for asking you questions. Is to get a better understanding of JavaMail and to clear up any doubt. That, I may have on this subject that is related to the statements and questions.
    By having some one like you respond to my questions with answers.
    Here we go!
    The content of the Part Interface and Message class are not attributes at all.
    If this statement is correct or not correct please explian why.
    Is this statement correct?
    A DataHandler is the class called DataHandler and the
    object of the DataHandler class, which programmers
    would call the DataHandler object; which is (normally
    created by using the DataHandler class constructor). The DataHandler class, wraps the data into the DataHandler object which is called DataHandler; by you or I using the DataHandler class constructor.
    This statement is correct right?
    The DataHandler class takes the data you pass to it's
    constructor and wraps it into the DataHandler's object
    as one entity called an email message.
    Is this statement correct?
    Thanks in advance.
    Please email me as soon as possible;
    at [email protected]
    Peace out, have a good day.
    -Leroy

  • How can I pass a docking container to a program in a non-simple context?

    Dear colleagues,
    I want to pass a docking container like the one in SE80 to another program.
    The following code works fine:
    REPORT z_moving_dock.
    DATA: cl_docker type REF TO cl_gui_docking_container.
    PARAMETERS: test.
    INITIALIZATION.
      CREATE OBJECT cl_docker EXPORTING no_autodef_progid_dynnr = 'X'.
    END-OF-SELECTION.
      WRITE:/ test.
    But I cannot extend this to my current program. There I sourced out anything related to the GUI into a function group to obey the MVC paradigma. (That's maybe the error in reasoning, but I'm following the book Design Patterns in Object-Oriented ABAP from SAP Press and -- of course -- good and healthy programming style.)
    So it's a function group which knows the dynpros and controls, the main program knows only the data.
    Now I have a docking container like the one in SE80. We have many working older programs and I want to switch to them carrying the docking container with me. I have searched the Demos in SAP, the Online Help, the SAP Library, Books, the Web, this Forum, but none of them goes beyond the simpler examples that always work.
    I tried the LINK method on the docking container. I tried it before calling the new program (btw. by SUBMIT). I tried it afterwards from the called program (via a function module from the aforementioned group -- but the group is tied to the old program context and therefore I am in a new "instance" of it). I tried different values for REPID and DYNNR in LINK. I debugged SE80 -- too complicated!
    If it works well I get the container back when I return to the calling program. If it works badly the container is completely lost.
    Perhaps I should export something to memory?
    But I strongly would prefer not to alter the called programs: In the future I might also want to call a SAP standard program.
    I also didn't find some documentation explaining what is going on in the background so I could figure out in which direction to "think".
    I also tested the following code on SAP R/3 4.7 and SAP ERP 2005 with the same results.
    In the meantime I also created a minimal example. First the triggering report:
    REPORT z_moving_docking_container.
    DATA: g_example TYPE REF TO zcl_moving_docking_container.
    CREATE OBJECT g_example.
    This obviously calls the main class ZCL_MOVING_DOCKING_CONTAINER which has only this constructor:
    METHOD constructor.
      CALL FUNCTION 'Z_SHOW_DYNPRO'.
    ENDMETHOD.
    Normally this class should handle the business logic. Here it only calls this function module. In the appropriate function group, say Z_MOVING_DOCKING_CONTAINER, I have these declarations in the TOP-Include:
    FUNCTION-POOL z_moving_docking_container.
    DATA:
      gv_okcode TYPE ui_func,
      go_docker TYPE REF TO cl_gui_docking_container.
    The function group also contains a dynpro 9000 with this flow logic:
    PROCESS BEFORE OUTPUT.
      MODULE status_9000.
    PROCESS AFTER INPUT.
      MODULE user_command_9000.
    The modules are straightforward:
    MODULE status_9000 OUTPUT.
      SET PF-STATUS '9000'.
      IF go_docker IS INITIAL.
        CREATE OBJECT go_docker
               EXPORTING no_autodef_progid_dynnr = 'X'.
      ENDIF.
    ENDMODULE.
    with at least the function code ONLI defined in PF-status 9000 and
    MODULE user_command_9000 INPUT.
      IF gv_okcode = 'ONLI'.
        SUBMIT z_sample_report AND RETURN.
      ELSE.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    The report Z_SAMPLE_REPORT can be any report you like.
    At last the function module contains the following code:
    FUNCTION z_show_dynpro.
    *"*"Lokale Schnittstelle:
      CALL SCREEN 9000.
    ENDFUNCTION.
    As I see this, this is a straightforward application of the working example at the top and the principles of MVC and encapsulation of the dynpro logic (to "avoid" global variables as best as possible).
    Clearly in some sense this is an academic question, but I have built a fairly big application like that up to now ...
    </edit>
    Thanks for reading and contemplating,
    Thomas
    Edited by: Thomas Geiß on Feb 4, 2009 11:03 AM
    Edited by: Thomas Geiß on Feb 4, 2009 11:59 AM
    Edited by: Thomas Geiß on Feb 4, 2009 12:01 PM

    You'll either have to pass the data in as parameters in the applet tags or create a JavaScript tag and have the JavaScript pass it in. If the array is very large then you open a connection between the Applet and a servlet and pass the data that way.

Maybe you are looking for