XSL Transform, double-byte characters and padding

I have a stylesheet with the following variable that is being formatted to pad a parameter named textQualifierDescription to a length of 30 by calling the template called format-string.
<xsl:variable name="textQualifierDescription2">
     <xsl:call-template name="format-string">
          <xsl:with-param name="myString" select="$textQualifierDescription"/>
          <xsl:with-param name="numbatchspaces">30</xsl:with-param>
     </xsl:call-template>
</xsl:variable>
<xsl:template name="format-string">
     <xsl:param name="myString" select="' ' "/>
     <xsl:param name="numbatchspaces" select="20"/>
     <xsl:param name="direction" select="right"/>
     <xsl:variable name="spacesstr" select="string('                                              ')"/>
     <xsl:variable name="padsize" select="$numbatchspaces -string-length($myString)"/>
     <xsl:variable name="spacepad" select="substring($spacesstr, 1, $padsize)"/>
     <xsl:choose>
          <xsl:when test="$direction = 'left'">
               <xsl:value-of select="concat($spacepad,$myString)"/>
          </xsl:when>
          <xsl:otherwise>
               <xsl:value-of select="concat($myString,$spacepad)"/>
          </xsl:otherwise>
     </xsl:choose>
</xsl:template>I execute the xsl transform using the following statement in a stored procedure:
transformedData := xmldata.transform(xsldata);The xsl transform works as expected until it encounters data that contains double-byte characters. My output is supposed to contain the following three fields as a single record
textQualifierDescription - padded to a length 30
lineNumber
id
If my textQualifierDescription contains a value of "Texto de posición"
Line 1 - Texto de posición             00000001POS2005
Line 2 - Texto de posición            00000001POS2005
Line 1 is the expected result.
Line 2 is the actual result. When the "format-string" function is called and even though "Texto de posición" is 17 characters in length, it looks as if oracle counts the double-byte character as 2 and calculates the string-length as 18 to come up with a padsize of 12. It then creates a spacepad of 12 spaces which is then concatenated to the 17 characters for a total length of 29. I have tested the stylesheet in xmlspy and it produces the expected result.
Has anyone ever run into this sort of situation and is able to provide me with some sort of solution to this dilemma? This is running on 10g Release 10.2.0.4.0.

Your searches should have also come up with the fact that CR XI R2 is not supported in .NET 2008. Only CR 2008 (12.x) and Crystal Reports Basic for Visual Studio 2008 (10.5) are supported in .NET 2008. I realize this is not good news given the release time line, but support or non support of cr xi r2 in .net 2008 is well documented - from [Supported Platforms|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7081b21c-911e-2b10-678e-fe062159b453
] to [KBases|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do], to [Wiki|https://wiki.sdn.sap.com/wiki/display/BOBJ/WhichCrystalReportsassemblyversionsaresupportedinwhichversionsofVisualStudio+.NET].
Best I can suggest is to try SP6:
https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe
MSM:
https://smpdl.sap-ag.de/~sapidp/012002523100000634042010E/crxir2sp6_net_mm.zip
MSI:
https://smpdl.sap-ag.de/~sapidp/012002523100000633302010E/crxir2sp6_net_si.zip
Failing that, you will have to move to a supported environment...
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Edited by: Ludek Uher on Jul 20, 2010 7:54 AM

Similar Messages

  • How to check double byte characters

    Hi
    My requirement: I have to accept the string (may include double byte characters and special characters). Need to check that wether that string contains any special characters(like %,&,..), if so should display error message.
    My solution: Starting i tried by usign the ASCII values. But the my code dividing the Double Byte characters into two characters.
    Code:
    package JNDI;
    public class CharASCIIValues {
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String s = args[0];
              char ch[] = s.toCharArray();
              for(int i=0;i<=ch.length;i++){
                   System.out.println(" "+ch[i]+"="+(int)ch);
    I ran with some double characters (japanese)
    But i got the out put was = ?=63 ?=63 ?=63 ?=63 ?=63 ?=63 1=49 2=50 3=51 h=104 e=101 l=108 l=108 o=111
    The ? are double byte charcters.
    Queries:
    Do i need to set any java setting to support DB characters.
    Please help me to come out this problem....any help/information will be appreciated.

    First of all Java strings are encoded in a modified version of UTF-8 that uses 2 bytes per character. That is the char datatype is equivalent to an unsigned short.
    Second what exactly do you mean by double byte? Whether a character ends up encoded in two bytes or not depends on the encoding used (UTF-8, UTF-16 (both unicode), BIG5, GB2312 (both chinese), iso-8859-1(Latin-1), ASCII, etc...). This means that there are no "double byte characters" there are only "double byte characters when encoded in <your encoding>".
    Where does your string come from? What encoding are you using to read the string in the first place? Are you sure you are creating the string using the right encoding?

  • Double Byte Characters for Japanese Kanji Language

    Hello All,
    How can you identify the Double Byte characters and how we can check whether they are double byte characters  or not.
    Can you please tell me the double byte characters from Japanese Kanji language for the characters.
    This is very urgent.I will reward you with points.
    Thanks,
    Karan

    *& Report  YTEST_LOGIC
    REPORT  teched_unicode_solution_1               .
    *** Exercise 1: Distinction between byte and character length
    *** after Unicode enabling
    parameter: param type c.
    PERFORM test1 USING param.
    *  FORM test1
    FORM test1 USING text TYPE c.
      DATA: len1 TYPE i,
            len2 TYPE i,
            off TYPE i.
    DESCRIBE FIELD text LENGTH len1 IN BYTE MODE.
    DESCRIBE FIELD text LENGTH len2 IN CHARACTER MODE.
    WRITE:/ LEN1, LEN2.
    ENDFORM.                                                    "test1
    Use the above code to find which characters are double bytes and which are not...
    The double byte characters will have double the length when they are in the byte mode..
    reward points for helpful answers
    Edited by: Rahul Kavuri on Mar 26, 2008 6:35 PM

  • Given filename or path contains Unicode or double-byte characters.Retry using ASCII characters for filename and path What does this mean? it happen when I publish an OAM

    Given file name or path contains Unicode or double-byte characters. Retry using ASCII characters for filename and path
    What does this mean? It is happening when I try to publish an OAM for Dreamweaver.
    Also: How can I specify the browser in Edge Animate? It is just going wherever. Are there no Preferences for Edge Animate?
    BTW. Just call it Edge. Seriously. Do you call it Illustrator Draw? Photoshop Retouching?

    No, my file name is mainContent.oam
    My project name is mainContent.an
    This error happens when I try to import into Dreamweaver. Sorry, I wasn't clear on that earlier.
    I thought maybe it was because I had saved my image as a png. So re-saved as a svg, still get the error.
    DO I have a setting is Dreamweaver CC that is wrong? Should I try this in Dreamweaver CS6? I might try that next.
    Why is this program so difficult? I know Flash. I know After Effects. I can work the timeline part just great. It's always in the export that I have problems.
    On a MacPro, 10.7.
    Are you an Adobe person or just a nice helper?

  • Sapshcut and  double-byte characters trouble?

    Hi experts,
    I did try some commands to log-on to SAP system as the following examples and get some conclusions:
    (1) sapshcut.exe -sysname="今ウィ ちゃわ異"  -user="paragon1"  -pw="paragon1"  -client="800" -language=en  -maxgui "
    (2) sapshcut.exe -sysname="EC5"  -user="paragon1"  -pw="paragon1"  -client="800" -language=en  -maxgui "
    - For the (1) case, with any "double-byte characters" sysname (Janpanese,...), I can not log-on to SAP and get "Microsoft Visual C++ Runtime Library" error message.
    - For the (2) case, without "double-byte characters" sysname, I can log-on to SAP easily.
    Thus, I wan to know
    1) Does the sapshcut.exe support double-byte characters?
    2) Do we have a way to use sapshcut.exe with double-byte characters(Japanese,...)?
    Kindly Regards,

    The comments on the bytes/strings were helpful. Thanks.
    But I'm still confused as to what matching pattern could be used.
    For example a pattern like:
    [A-Za-z]
    I assume would not match any double byte characters.
    I also assume the following won't work either:
    [\\p{Alpah}]
    because it is posix - US-ASCII only.
    So how do you say "match the tag, then take any characters,
    double byte, ascii, whatever, then match the text tag - per the
    original example ?

  • Regular Expressions and Double Byte Characters ?

    Is it possible to use Java Regular Expressions to parse
    a file that will contain double byte characters ?
    For example, I want a regular expression to match the following line
    tag="double byte stuff" id="double byte stuff"

    The comments on the bytes/strings were helpful. Thanks.
    But I'm still confused as to what matching pattern could be used.
    For example a pattern like:
    [A-Za-z]
    I assume would not match any double byte characters.
    I also assume the following won't work either:
    [\\p{Alpah}]
    because it is posix - US-ASCII only.
    So how do you say "match the tag, then take any characters,
    double byte, ascii, whatever, then match the text tag - per the
    original example ?

  • How best to send double byte characters as http params

    Hi all
    I have a web app that accepts text that can be in many languages.
    I build up a http string and send the text as parameters to another webserver. Hence, whatever text I receive i need to be able to represent on a http query string.
    The parameters are sent as urlencoded UTF8. They are decoded by the second webserver back into unicode and saved to the db.
    Occassionally i find a character that i am unable to convert to a utf8 string and send as a parameter (usually a SJIS character). When this occurs, the character is encoded as '3F' - a question mark.
    What is the best way to send double byte characters as http parameters so they always are sent faithfully and not as question marks? Is my only option to use UTF16?
    example code
    <code>
    public class UTF8Test {
    public static void main(String args[]) {
    encodeString("\u7740", "%E7%9D%80"); // encoded UTF8 string contains question mark (3F)
    encodeString("\u65E5", "%E6%97%A5"); // this other japanese character converts fine
    private static void encodeString(String unicode, String expectedResult) {
    try {
    String utf8 = new String(unicode.getBytes("UTF8"));
    String utf16 = new String(unicode.getBytes("UTF16"));
    String encoded = java.net.URLEncoder.encode(utf8);
    String encoded2 = java.net.URLEncoder.encode(utf16);
    System.out.println();
    System.out.println("encoded string is:" + encoded);
    System.out.println("expected encoding result was:" + expectedResult);
    System.out.println();
    System.out.println("encoded string16 is:" + encoded2);
    System.out.println();
    } catch (Exception e) {
    e.printStackTrace();
    </code>
    Any help would be greatly appreciated. I have been struggling with this for quite some time and I can hear the deadline approaching all too quickly
    Thanks
    Matt

    Hi Matt,
    one last visit to the round trip issue:
    in the Sun example, note that UTF8 encoding is used in the method that produces the byte array as well as in the method that creates the second string. This is equivalent to calling:
    String roundTrip = new String(original.getBytes("UTF8"), "UTF8");//sun exampleWhereas, in your code you were calling:
    String utf8 = new String(unicode.getBytes("UTF8"))//Matt's code
    [/code attracted
    The difference is crucial.  When you call the string constructor without a second (encoding) argument, the default encoding (usually Cp1252) is used.  Therefore your code is equivalent toString utf8 = new String(unicode.getBytes("UTF8"), "Cp1252")//Matt's code
    i.e.you are encoding with one transformation format and decoding back with a different transformation format, so in general you won't get your original string back.
    Regarding safely sending multi-byte characters across the Internet, I'm not completely sure what the situation is because I don't do it myself. (When our program is run as an applet, the only interaction it has with the web server is to download various files). I've seen lots of people on this forum describing problems sending multi-byte characters and I can't tell whether the problem is with the software or with the programming. Two possible methods come to mind (of course you need to find out what your third party software is doing):
    1) use the DataOutput/InputStreams writeUTF/readUTF methods
    2) use the InputStreamReader/OutputStreamWriter pair with UTF8 encoding
    See this thread:
    http://forum.java.sun.com/thread.jsp?forum=16&thread=168630
    You should stick to UTF8. It is designed so that the bytes generated by encoding non-ASCII characters can be safely transmitted across the Internet. Bytes generated by UTF16 can be just about anything.
    Here's what I suggest:
    I am running a version of the Sun tutorial that has a program running on a server to which I can send a string and the program sends back the string reversed.
    http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
    I haven't tried sending multi-byte characters but I will do so and test whether there are any transmission problems. (Assuming that the Sun cgi program itself correctly handles characters).
    More later,
    regards,
    Joe
    P.S.
    I thought one the reasons for the existence of UTF8 was to
    represent things like multi-byte characters in an ascii format?Not exactly. UTF8 encodes ascii characters into single bytes with the same byte values as ASCII encoding. This means that a document consisting entirely of ASCII characters is the same whether it was encoded as UTF8 or ASCII and can consequently be read in any ASCII document reader (e.g.notepad).

  • Double byte characters in dataset

    Hi Gurus,
    I encounter an issue when writing data to dataset with fixed length.
    Company Code: US00
    Document Number: 1234567890
    Fiscal Year: 2014
    Line Item: 001 Short Text ( length 10 char): AF 16
    Line Item: 002 Short Text ( length 10 char): AF 16 
    Comment:X
    In Unix, it becomes like this:-
    US0012345678902014001AF16      X
    US0012345678902014001AF 16       X
    The X in second line item was not in correct fixed position and cause file being rejected by the receiver system.
    I have tried to calculate using the following syntax for AF 16  :
    1) strlen(bseg-sgtxt) = 7
    2) numofchar(bseg-sgtxt) = 6
    I would like to know if there is any idea to resolve the position of subsequent fields after "SGTXT" field if there is double byte characters found. I have tried to pad trailing space but it does not work.
    Expected result is where the X of two line items are located at same and fixed position:-
    US0012345678902014001AF16      X
    US0012345678902014001AF 16    X
    Thank you!

    /** returns true if the String s contains any "double-byte" characters */
    public boolean containsDoubleByte(String s) {
      for (int i=0; i<s.length(); i++) {
        if (isDoubleByte(s.charAt(i)) {
          return true;
      return false;
    /** returns true if the char c is a double-byte character */
    public boolean isJapanese(char c) {
      if (c >= '\u0100' && c<='\uffff') return true;
      return false;
    // simpler:  return c>'\u00ff';
    /** returns true if the String s contains any Japanese characters */
    public boolean containsJapanese(String s) {
      for (int i=0; i<s.length(); i++) {
        if (isJapanese(s.charAt(i)) {
          return true;
      return false;
    /** returns true if the char c is a Japanese character. */
    public boolean isJapanese(char c) {
      // katakana:
      if (c >= '\u30a0' && c<='\u30ff') return true;
      // hiragana
      if (c >= '\u3040' && c<='\u309f') return true;
      // CJK Unified Ideographs
      if (c >= '\u4e00' && c<='\u9fff') return true;
      // CJK symbols & punctuation
      if (c >= '\u3000' && c<='\u303f') return true;
      // KangXi (kanji)
      if (c >= '\u2f00' && c<='\u2fdf') return true;
      // KanBun
      if (c >= '\u3190' && c <='\u319f') return true;
      // CJK Unified Ideographs Extension A
      if (c >= '\u3400' && c <='\u4db5') return true;
      // CJK Compatibility Forms
      if (c >= '\ufe30' && c <='\ufe4f') return true;
      // CJK Compatibility
      if (c >= '\u3300' && c <='\u33ff') return true;
      // CJK Radicals Supplement
      if (c >= '\u2e80' && c <='\u2eff') return true;
      // other character..
      return false;
    /* NB CJK Unified Ideographs Extension B not supported with 16-bit unicode. Source: http://www.alanwood.net/unicode */
    }

  • Text strings from VISA read don't match identical looking text constants - could it be double byte characters"

    Our RS232-enabled instrument sends ASCII strings to COM 1 and I read strings in. For example I get the string "TPM", or at least it looks like "TPM" if I display it. However, if I send that to the selector input of a Case structure, and create a case for "TPM", whether the two appear to match varies. Sometimes it matches, and measuring its length returns 3. Sometimes it measures 7 or 11 or 12 characters long, and it doesn't match. I can reproduce a match or a mismatch by my choice of the command that went to the instrument prior to the command that causes the TPM response, but have made no sense of this clue. I have run it through Trim Whitespace, with Both Ends (the default) explicitly selected. I have also turned the string into a byte array, autoindexed a For loop on that, and only passed the bytes if they don't equal 32, or if they don't equal 0, thinking spaces or nulls might be in there, but no better.
    The Trim Whitespace function's Help remarks that it does not remove "double byte characters". But I can't find anything else about "double byte characters". Could this be the problem? Are there functions that can tell whether there are "double byte characters", or convert into or out of them? By "double byte characters", do they just mean Unicode?
    Solved!
    Go to Solution.

    Cebailey,
    The double byte characters are generally used for characters specific to languages other than English.  If you display your message in  " '\' Codes Display"  in a string indicator do you see any other characters?   You could also use Hex Display to see count the number of bytes in the message.  You are probably getting messages with non-printable characters that might need to be trimmed before using your application.  If you want more information the '\' Codes Display, there's a detailed description found in the LabVIEW Help.  You can also find the same information on our website in the LabVIEW Help.  Backslash ('\') Codes Display
    Caleb WNational Instruments

  • Using Double Byte Characters in URL For Session Variables

    When I supply the value for a session variable in the URL for an IRPT page where the value contains double byte characters, Japanese in this case, the characters are corrupted by the time they are entered for the session variables.  Does anyone know a solution to this problem or experience in this area?  Currently using xMII 11.5 SR3.

    Hi Bryan,
    I would suspect that under the covers the session variable is of datatype string.  For double byte characters, it would need to be wstring.  There is a better explanation to be found at:
    Link: [Kanji and Java Datatypes|http://www.unix.com.ua/orelly/java-ent/jenut/ch10_04.htm] or you can try google on  Kanji Datatype  OR Kanji Java Datatype
    It could also be a problem with the operating system which I ran into about 10 years ago, but I would hope that Microsoft had moved beyond that by now.
    Maybe some more technical folks could chime in to confirm or deny my explanation.
    Mike
    Edited by: Michael Appleby on Jul 8, 2008 5:23 PM

  • Invoke-WebRequest - Double byte characters issue in windows 8.1

    I try write a powershell script to download a file from web server but failed. The path have double byte characters.
    I could run in Windows server 2012 and 2012 R2 successfully, but fail in Windows 8 & 8.1
    Do there any difference below Windows server and client powershell?
    Region and setting are same in Windows 2012 & Windows 8
    Script as below
    Invoke-WebRequest -Uri " http://hostname/m/%E9%...../......./...../xxx.jpg"

    Security settings are one possible cause of this.
    Since we don't have your URL we cannot reproduce this. 
    It is "different". Using "difference" had me confused for qa bit.  I though you were trying to figure out the difference between two things.
    Use:
    $wc=New-Object System.Net.WebClient
    $ws.DownloadFile($url,'c:\file.jpg')
    You will see less issues and it is faster.
    ¯\_(ツ)_/¯

  • SJIS- Japan Encoding Issues(*Unable to handle Double Byte Numeric and Spec)

    Hi All,
    Problem:
    Unable to handle Double Byte Numeric and Special Characters(Hypen)
    The input
    区中央京勝乞田1944-2
    Output
    区中央京勝乞田1944?2
    We have a write service created based on the JCA (Write File Adapter) with the native schema defined with SJIS Encoding as below.
    *<?xml version="1.0" encoding="SJIS"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:tns="http://nike.com/***/***********"
         targetNamespace="http://nike.com/***/*************"
         elementFormDefault="unqualified" attributeFormDefault="unqualified"
         nxsd:version="NXSD" nxsd:stream="chars" nxsd:encoding="SJIS">*
    Do anyone have similar issue? How can we handle the double byte characters while using SJIS encoding? At the least how can we handle double byte hyphen ??
    Thanks in Advance

    Have modified my schema as shown below and it worked well for me and i am partially successful up to some extent. Yet, not sure the workaround will resolve the issue at the final loading...
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:tns="http://nike.com/***/***********"
    targetNamespace="http://nike.com/***/*************"
    elementFormDefault="unqualified" attributeFormDefault="unqualified"
    nxsd:version="NXSD" nxsd:stream="chars" nxsd:encoding="UTF-16">*
    If anyone has the resolution or have these kind of issues let me know.........

  • How do I know that there are double-byte characters in s String?

    Hi!
    If I have a String that contain English and Chinese words,
    How do I know that the String contain double-byte characters(Chinese words)?
    Following is my method and the problem I suffered...
    String A = "test(double-byte chinese)test";
    byte B[] = A.getBytes();
    if(A.length() != B.length)
    System.out.print("String contains double-byte words");
    else
    System.out.print("String does not contain double-byte words");
    If the String contains Chinese words,then A.length() will be smaller than B.length...
    I run the program on Window NT workstation(Tradtional Chinese version) and it works...
    Then I run the same program on Redhat 6.0(English version),
    but the result was not the same as running on NT...
    because A.length() always equal to B.length...
    I guess that's because of Charset of OS...
    But I don't know how to set the Charset of Linux...
    Does anybody have other solution to my problem?
    Any suggestion will be very appreciate!

    A String is always in Unicode. You cannot see what kind of character is in the string unless you compare with the Unicode range of charcters. E.g. 3400-4DB5 is CJKUnified Ideographs extension A. Then you at least know that is is not Latin-1 or other.
    Klint

  • Java apps refuse to accept double byte characters

    Java apps refuse to accept double byte characters
    In my user account, all java apps now refuse to accept double-byte characters (Chinese, Japanese, etc). I have another clean account, and that one works fine.
    Things I tried doing:
    * repair permissions
    * search/delete .plist files with java as a part of the name
    * search/detete .plist file that has to do with TCIM, input method
    Nothing worked…
    MacBook Pro 15" early 2011, Lion 10.7.3.
    Can anyone help?

    Well, there is no guarantee that you can detect double-byte characters. However if you believe strongly that a file DOES contain double-byte characters, written in big-endian or little-endian format, then you can look at the first two bytes of the file:
    FFFE big-endian.
    FEFF little-endian.
    Code tip: Open the file as a FileInputStream, then wrap it in a PushbackInputStream. This allows you to read the first two bytes (so you can examine them), and push them back. If you find the expected encoding, then you can wrap the PushbackInputStream in an InputStreamReader, specifying the appropriate (big-endian or little-endian) decoding.
    Setup tip: I believe the decoding will only work if you have internationalization set up do this by copying i18n.jar from the lib directory (of the JRE) to the extension directory (of the JRE).

  • How to display double byte characters with system.out.print?

    Hi, I'm a newbie java programmer having trouble to utilize java locale with system io on dos console mode.
    Platform is winxp, jvm1.5,
    File structure is:
    C:\myProg <-root
    C:\myProg\test <-package
    C:\myProg\test\Run.java
    C:\myProg\test\MessageBundle.properties <- default properties
    C:\myProg\test\MessageBundle_zh_HK.properties <- localed properties (written in notepad and save as Unicode, window notepad contains BOM)
    inside MessageBundle.properties:
    test = Hello
    inside Message_zh_HK.properties:
    test = &#21890; //hello in big5 encoding
    run.java:
    package test;
    import java.util.*;
    public class Run{
      public static void main(String[] args){
        Locale locale = new Locale("zh","HK");
        ResourceBundle resource =
            ResourceBundle.getbundle("test.MessageBundle", locale);
        System.out.println(resource.getString("test"));
      }//main
    }//classwhen run this program, it'll kept diplay "hello" instead of the encoded character...
    then when i try run the native2ascii tool against MessageBundle_zh_HK.properties, it starts to display monster characters instead.
    Trying to figure out what I did wrong and how to display double byte characters on console.
    Thank you.
    p.s: while googling, some said dos can only can display ASCII. To demonstrate the dos console is capable of displaying double byte characters, i wrote another helloWorld in chinese using notepad with C# and compile using "csc hello.cs", sure enough, console.write in c# allowed me to display the character I was expecting. Since dos console can print double byte characters, I must be missing something important in this java program.

    after google a brunch, I learned that javac (hence java.exe) does not support BOM (byte order mark).
    I had to use a diff editor to save my text file as unicode without BOM in order for native2ascii to convert into a ascii file.
    Even the property file is in ascii format, I'm still having trouble to display those character in dos console. In fact, I just noticed I can use system.out.println to display double byte character if I embedded the character itself in java source file:
    public class Run {
         public static void main(String[] args) throws UnsupportedEncodingException{
              String msg = "&#20013;&#25991;";    //double byte character
                    try{
                    System.out.println(new String(msg.getBytes("UTF-8")) + " new string");  //this displays fine
                    catch(Exception e){}
                    Locale locale = new Locale("zh", "HK");
              ResourceBundle resource = ResourceBundle.getBundle("test.MessagesBundle", locale);
                    System.out.println(resource.getString("Hey"));      //this will display weird characterso it seems like to me that I must did something wrong in the process of creating properties file from unicode text file...

Maybe you are looking for

  • Portrait display resolution issue since upgrading to Mountain Lion

    Hello. I'm running a Mac Mini 2011 with the 2.5 GHz i5 and Radeon HD 6630m graphics. I run two monitors, one via HDMI and via the Mini DisplayPort to VGA adaptor. The HDMI connection runs landscape, the VGA portrait. Since updating from Lion to Mount

  • Ugly Xfree86 Upgrade

    My apologies for the ugly Xfree86 upgrade that's waiting in the repositories. With XFree86 4.2.x we used external fontconfig and xft2 libraries to render truetype fonts.  Then Xfree86 4.3.0 came out and used its own internal versions of these librari

  • Conference room microphone for MBP

    I run video conferences via GoToMeeting, using iChat to show remote guest speaker on desktop. The venue may be a meeting room or small auditorium. I've been trying to use a wireless mic to input meeting room participants and audience questions, but t

  • Resultset view

    hi Expert, my environment is  mdm  5.5 and nw 7 portal. our scenario is: we have to provide a  link(url) to external system, the link contains some parameters. the portal page should display records, which matches criterion specified in the url. i fo

  • Forreign currence

    Hi, Experts i have query regarding the currency, my client is having companies in USA and INDIA, in Indian company they are using INR currency,but they want to change currency for Indian company  to USD currecy. reason is for the preparation of IFRS