Utf-8 on Windows and java 1.4.2

There is a problem in running my application on Windows (2000, 2003, etc.) using java 1.4.2_x. The same code is working fine on Linux.
Furhtremore, the same code is working fine with java 1.4.1_x on both OS's
The application is reading an XML file and it is printing some of the values on an HTML page. If the values are in non-latin characters, with java 1.4.2_x running on Windows, they are not presented correctly.
Dejan

Then the application is not handling the XML file's encoding properly. Or else whatever it is that is "printing" (very strange term) the XML on the HTML page is not setting the HTML page's encoding correctly.
Control the encodings in the proper way and the program should work correctly on all platforms.

Similar Messages

  • Compiling for Windows and Java

    Hi All
    This is a deff newbie question. Basically i have a program that will compile in Windows, but if I try and compile it in Linux (CentOS) then I get 48 errors all related to graphics of constructors.
    It was my understanding that Java was meant to be platform independent, or is that just a myth?
    Is there any way that i can resolve this, or find a tool that will show me what wont compile under linux and why?

    I have a
    program that will compile in Windows, but if I try
    and compile it in Linux (CentOS) then I get 48 errors
    all related to graphics of constructors. Difficult to say without the actual compiler messages.
    You may be missing some jar(s) in your classpath.

  • Windows and Java

    I am not a software developer, but I am in need of some information. Can anyone explain to me in detail the drawbacks of a Java application running on Windows in a client server environment?
    Thanks!

    There are none. What kind of problems did you anticipate?

  • Fonts in Windows and Fonts in Java

    Hello,
    Say I have in my app:
    String string = "\\u09A1";
    I want to display this in my app. I can call:
    GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    I can then iterate through these and find out which ones can display this unicode character using,
    font.canDisplayUpTo(string);
    My question is, are these the fonts that Java can display (from charsets.jar) or the ones installed in Windows?
    I would like to be able to get lists for both of these.
    Any ideas?
    Cheers,
    Jim

    Thank you. I did read that. I was not talking about drawing text in 'Hello World' alike applets/programs.
    I should give an example:
    I would like to print 'H' in Tahoma, 72, Bold (Windows format) at (100, 200).
    Font sizes:
    In Windows font size is 72 pixels.
    In Java this is equal to 96 points (72 px * 96 (scr resolution for Toolkit) / 72 (pixels per point).
    Real height in Windows and Java will be 64 px.
    That's fine. For some fonts this does not work.
    Positioning. See example above.
    According to the article you refer to in java we should use y-coordinate 200 + 72 (font size) = 272.
    In fact we have :
    Java text 14 pixels below than expected.
    Similar things happen to other parameters Weight, Styles, etc.
    I do use AttributedString and TextAttribute classes to render text
    Thanks in advance.
    Alex

  • Oracle 9i +Java: Change string encoding from UTF-16 to Windows-1251

    Dear colleagues,
    I have a very urgent case: need to change encoding of the string retrieved from the file (with encoding UTF-16) to Windows-1251 and put it to db table, to CLOB field.
    Code of the Java function
    +public static void file2table(String sql, String fileName, String characterSet, int asByteArray) throws SQLException, IOException {+
    Connection con = null;
    Writer writer = null;
    Reader reader = null;
    +try {+
    con = getConnection();
    PreparedStatement ps=con.prepareStatement(sql);
    reader = new InputStreamReader(new BufferedInputStream(new FileInputStream(new File(fileName))), characterSet);
    BufferedReader br = new BufferedReader(reader);
    String s;
    +while ((s = br.readLine()) != null) {+
    byte[] defaultBytes=s.getBytes(characterSet);
    String win1251str=new String(defaultBytes, "windows-1251");
    +if(asByteArray>0) {+
    ps.setBytes(1, defaultBytes);
    +//ps.setBytes(1, win1251str.getBytes("windows-1251"));+
    +} else {+
    ps.setString(1, s);
    +}+
    ps.executeUpdate();
    +}+
    con.commit();
    +} finally {+
    +if (reader != null) {reader.close();}+
    +if (con != null) {con.close();}+
    +}+
    +}+
    I was check, all bytes from the file received correctly. But if I put readed bytes to database table, result text in table is broken.

    >
    Yes, currently I already have filled table with all file lines in result table but with incorrect encoding
    >
    No you haven't - not using the code you posted. You can't save LOB data using only the BLOB or CLOB.
    That isn't data that you strored - it is garbage that is being stored as the LOB locator.
    I ask you why you were trying to store the data that way instead of the way the doc shows you and you said
    >
    Because var. s is type of Java String.
    For method setClob must be use type of CLOB
    >
    You are teriibly confused about LOBs. A BLOB or CLOB Java datatype is the LOB LOCATOR and doesn't contain any data.
    Yes - it is true that method setClob must be of type CLOB but that CLOB instance HAS TO BE THE LOB LOCATOR - not the data.
    You access LOB data using streams. To store LOB data you have to RETRIEVE (not send) a LOB locator from the database and then use the locator's stream to send the actual data.
    So if you are creating a new record in the table you typically do an INSERT that includes an EMPTY_LOB() and have the newly created LOB locator returned to you. Then you use that locators stream to send the actual data.
    Since you are not doing that your approach will not work.
    Here is a link to the 9i JDBC Dev Guide
    http://docs.oracle.com/cd/B10501_01/java.920/a96654.pdf
    See page 8-2 to start with
    >
    BLOB and CLOB data is
    accessed and referenced by using a locator, which is stored in the database table and
    points to the BLOB or CLOB data, which is outside the table.
    To work with LOB data, you must first obtain a LOB locator. Then you can read or
    write LOB data and perform data manipulation. The following sections also
    describe how to create and populate a LOB column in a table.
    The oracle.sql.BLOB and CLOB classes implement the java.sql.Blob and
    Clob interfaces, respectively (oracle.jdbc2.Blob and Clob interfaces under
    JDK 1.1.x). By contrast, BFILE is an Oracle extension, without a corresponding
    java.sql (or oracle.jdbc2) interface.
    Instances of these classes contain only the locators for these datatypes, not the data.
    After accessing the locators, you must perform some additional steps to access the
    data. These steps are described in "Reading and Writing BLOB and CLOB Data" on
    page 8-6 and "Reading BFILE Data" on page 8-22.
    Note: You cannot construct BLOB, CLOB, or BFILE objects in your
    JDBC application—you can only retrieve existing BLOBs, CLOBs,
    or BFILEs from the database or create them using the
    createTemporary() and empty_lob() methods.
    >
    Read the above quotes several times until you understand what they are telling you. These are the two main concepts you need to accept:
    >
    To work with LOB data, you must first obtain a LOB locator.
    You cannot construct BLOB, CLOB, or BFILE objects in your JDBC application
    >
    See the example code and description starting on page 8-11 for how to populate a LOB column in a table
    >
    Create a BLOB or CLOB column in a table with the SQL CREATE TABLE statement,
    then populate the LOB. This includes creating the LOB entry in the table, obtaining
    the LOB locator, creating a file handler for the data (if you are reading the data from
    a file), and then copying the data into the LOB.
    >
    Until you start using the proper methodology you are just wasting you time and will not be successful.

  • Java for PI 7.1 EHP1 in Windows and SQL Server 2008

    Hi Gurus
    I try to install PI 7.1 EHP1 in Windows and SQL Server 2008. The questions is :
    What version of java is the correct for this installation???
    And where i can download it??
    Thanks and advance!!!

    Hi Aaron,
    The version for PI 7.1 is 1.5, instead of the 1.4.2 of 7.0/3.0.
    Anyway, for VM settings, you should refer to SAP JVM, which
    is used for the PI 7.11.
    Hope it helps!
    Regards,
    Caio Cagnani

  • When i download software, then go to the download window and click on the file, it is aking me to open it with a launch application. how do i figure out what app to use. ex; downloaded a new version of java, what app do i use to install?

    when i download software, then go to the download window and click on the program , i'am being ask to choose a launch program. how do i figure out what app to use to install. ex: i downloaded a new version of java and a game program. how do i install?

    Where did you download the java?
    Download it from here [https://www.java.com/en/download/index.jsp https://www.java.com/en/download/index.jsp]

  • How to trace changes in directories and files in windows using java.

    Hi,
    Want to know how to trace changes in directories and files in windows using java.
    I need to create a java procedure that keeps track of any changes done in any directory and its files on a windows System and save this data.
    Edited by: shruti.ggn on Mar 20, 2009 1:56 AM

    chk out the bellow list,get the xml and make the procedure.....     
         Notes          
    1     Some of the similar software’s include HoneyBow, honeytrap, honeyC, captureHPC, honeymole, captureBAT, nepenthes.     
    2     Some of the other hacking software’s include keyloggers. Keyloggers are used for monitoring the keystrokes typed by the user so that we can get the info or passwords one is typing. Some of the keyloggers include remote monitoring capability, it means that we can send the remote file across the network to someone else and then we can monitor the key strokes of that remote pc. Some of the famous keyloggers include win-spy, real-spy, family keylogger and stealth spy.          
    3     Apart from theses tools mentioned above there are some more tools to include that are deepfreeze, Elcomsoft password cracking tools, Online DFS, StegAlyzer, Log analysis tools such as sawmill, etc.

  • String.getBytes (java) o/p different in Windows and Unix

    Hi,
    I was trying out the following code, which gives me a byte array from a
    String object.
    byte[] bytArr = null;
    bytArr = <String object>.getBytes("UnicodeBigUnmarked");
    System.out.println(bytArr.toString());
    The output is different in Windows and in Unix. The assumed that the reason could be because Intel architecture is based on little_endian so the difference in output. I changed the code to the following
    bytArr = <String object>.getBytes("ISO8859_1");
    and then ran the class file by using "java -Dfile.encoding=ISO8859_1" so that the toString can also take the character encoding of ISO8859_1 rather than using the platform dependent one. Still the result is different in Windows and Unix.
    What could be the reason for this? How can I correct this ? Any help in this regard is welcome.
    cheers
    kk

    Hi Sabre150,
    Thanks for the suggestion, it worked. Both the o/p shows the same if I use System.out.println(Arrays.toString(bytArr));
    I am assigning full points to you. Thanks a ton for the help.
    To end with I have one more question, the method Arrays.toString is introduced from jdk1.5, so if I want to use jdk 1.4 what should I use instead of Arrays.toString ?
    It would be great if I can get this answer.
    cheers
    kk

  • How to find cd rom drive in windows and unix platform using java program

    Hi,
    I am having the requirement of finding the cd rom drive
    using java program. I do not know the label and which
    one is the cd rom drive. also I want to know how many
    cd rom drives are there on my system. I want the solution
    for windows and unix platforms.
    If have any suggestions please mail to [email protected]
    Deepak

    Ughhh.. I had the same problem with multi platform file-system detection
    First off - Unix.
    Do you know for sure you have all your drives mounted?? This could be a big problem because java will not see unmounted drives... So you can scour thru your /etc/fstab to find out which drives are available... or you can mount all and show roots... (Yuck!)... You've got timeouts and all sorts of things to worry about...
    I would then shy away from the java.io.File.listRoots() on unix and rely on parsing your fs file. If a user would like to see the medium in the drive. Do a Runtime.exec and mount the drive, then you can grab the filesystem by wrapping it in the java.io.File object. ( NOTE - this will hold well for your NFS mounts as well which might be buried under other FS. So you now have detection for that as well. ) Labels are also noted in this file. Let me know if you don't know the difference between mtab and fstab....
    Second - Winders.... Corney but I love saying that.
    The listRoots is a good solution. As others have said CD-ROMS will not be writable. Use a combination of getName and getPath to decipher the label and mount point.
    Hope this helps!

  • Perform Hamming window and FFT with Java

    Hi all,
    I am trying to apply Hamming window on my lengthy sound data soundSample[1000] with window length 100. Then proceed with FFT.
    And i found that java does have the package for Hamming window and FFT. As below,
    http://code.compartmental.net/minim/javadoc/ddf/minim/analysis/FFT.html
    http://marf.sourceforge.net/api/marf/math/Algorithms.Hamming.html
    But i hardly find an example that illustrate how to use the package in a java program. So no idea how should i use the method in package.
    Please advise and appreciate if reference is provided.
    Thank you.

    Hi,
    I have spent sometimes to study and do the coding for FFT on audio samples.
    My project is to study the FFT working by performing the FFT on audio sampled data.
    After this is done, then only proceed to extract the pitch value in the audio data.
    Below is the coding that i have done by referring to the provided steps:
    In my main, i call this method and past the retrieved sampled sound data to this method.
    public static void Analyze(int[] soundSample,float sample_rate ) {
            int N = (int)sample_rate/5;
            int Number_Sample = soundSample.length;
            Complex[] fftBuffer = new Complex [2*N];
            Complex[] fftResult = new Complex [2*N];
            Complex [] lastN = new Complex [N];   // The array to save the last N sample
            int delay = 0;
            double delta = 2*Math.PI/(2*N);
            // I have no idea how can i convert my sample array to double so that it will be in the range of [-1,+1]
            while(delay <=soundSample.length){
                //Extract the 2N sample for FFT analysis and convert the data to complex number.
                for (int z=0; z<2*N; z++){
                    fftBuffer[z] = new Complex(soundSample[z+delay],0) ;                
                for (int i=N-1;i>=N/2; i-- ){
                    lastN[N-1-i] = fftBuffer;
    for (int z=0; z<2*N; z++){
    fftBuffer[z] = fftBuffer[z].times(0.54-0.46*Math.cos(z*delta));
    fftResult = FFT1.fft(fftBuffer);
    delay = 2*N + delay;
    1) I was trying to perform FFT with 2N samples then keep on looping the FFT method until 2N reaches the ends of sampled data.
    But the FFT that i am working with is radix 2... It doesn't work with my 2N samples... Please teach me how should i work out FFT regardless the number of sample?
    2) The hamming window coefficient i m using is based on http://www.mathworks.com/help/toolbox/signal/hamming.html . I am working on index [0:2N] ..
    Is it appropriate?
    3) According to your No1 steps, the acceptable frequency resolution is 5Hz. May i know what is this representing? And is it application for most of the FFT application? How can i determine the frequency resolution that i should used in my project?
    Sorry for late reply as i was trying to work out the thing..
    Hereby attach to your the my coding.. and hopes to have your guidance and tutorial how to extract the pitch for recording audio file with Java.
    I have done the pitch extraction with MATLAB.. but Matlab as built-in FFT function... 
    So i m now get stucked how to perform FFT on audio sound sample regardless the N value of sound sample for FFT buffer.
    Many thanks for your former advise... and
    Looking forward for your replies again.
    Happy New Year 2011 :)
    Edited by: 诸葛 on Dec 31, 2010 9:29 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Install Java (1.4) and Java (1.5) on the same Windows XP mc reqd for 2 apps

    I have a requirement to install 2 different versions of Java (1.4) and Java (1.5) on the same Windows XP machine. There are 2 applications one uses Java (1.4) and the other Java (1.5)
    Both the application is run by taking the JAVA Path , Classpath specified in the Environment variables on the Advanced tab in My Computer. How to achieve it ? Immediate help is required. Thanks in advance.

    {color:#ff0000}{size:20px}CROSS POSTED{size}{color}
    [http://forums.sun.com/thread.jspa?threadID=5333227]
    Cross posting is rude.
    db

  • Windows Server 2003 64bit and Java 1.5.0, does it support 64bit processing?

    I have search the Sun website, Google etc but I am unable to find a definitive statement as to whether Java 1.5.0 has support for 64 bit processing when run on on Windows Server 2003 64bit?
    There appears to be separate 64 bit versions available for down load on the Solaris platform but not on Windows Server 2003 64bit. Is there for a reason for this?
    If some one could clarify the situation it would be greatly appreciated.
    Regards Mike Kimber

    Thanks AMN for quick reply.
    I have tried IE6 and IE7. Oracle application server10.1.2. I have developed a warehouse management s/w. I tried to open a form. I give one more info that I have two virtaul machine windows 2003 server and windows XP on Microsoft Virtual PC. Oracle application server setup is same on Virtual pC. It is working on virtual PC. I do not understand where is the problem on physical server.
    Confuguration is like this.
    1. Windows 2003 server with service pack 2 ---> Oracle Application server 10.1.2 + Java 1.5.0.7
    2. Windows XP with service pack3 ---> Oracle 10g Database
    3. Windows XP with service pack3 ---> java 1.5.0.7 as a client
    4. Windows Vista ultimate ---> java 1.5.0.7 and java 1.5..0.13 It is working fine. I mean when i try to run a form from Vista , it is working.
    Please help me. I will be very thanful to you. If you need any other info , i will send.
    Thanks again
    Haider

  • Get Native Java Window using Java Access Bridge 2.0.1 & Java 1.6 and above

    I want to get the native java window (Like Java Monkey Application and Java Ferret Application) using java only, for that I tried different ways/options but unable to get the native java window and perform actions on that.
    It would be really great if you could guide me for that. I am still unable to start the Java Access Bridge.
    Please let me know the steps to get native java window using Java Access bridge and JDK 1.6.20.
    Also Note that, As per your previous suggestion, I tried to search and call initializeAccessBridge() and shutdownAccessBridge(), But unable to succeed it. I did not find such method in Accessbridge.jar.
    Please help me out.
    Best Regards

    You might want to check out this thread:
    Java Access Bridge and JRE 1.6
    If you have Java 6, you'll need to manually install Java Access Bridge 2.0.1. The JAB 2.0.2 installer for Java 6 is also available as a beta:
    http://jdk6.java.net/6uNea.html

  • Differences on Windows and Linux JVM about java.util.zip package

    Hello, there!
    I need some help if someone else has already face this problem.
    I have a Java server that process the bytes of a SWF File stored in the server and ouptut it to the user through a Servlet. The file was decompressed and re-compressed using the java.util.zip package (Deflater/Inflater).
    Everything works fine on Windows Server 2008 server. But now we need to migrate the server to Linux. The problem is that when I test the website now, the file seens to be corrupted.
    What really intrigues me is that everything runs normal on Windows Server configuration, when changed to Linux, the final file seens to be corrupeted... what could possible be the cause? Is there any difference between java.util.zip package on Window and Linux JVM?
    My Windows Server is:
    . Windows Server 2008 (6.0 - x86)
    . Apache 2.2.11
    . Tomcat 6.0.16.0
    . Java JDK 1.6.0_12-b04
    My CentOS Server is
    . CentOS 5.4 (2.6.18-164.15.1.el5 - i386)
    . Apache 2.2.3
    . Tomcat 6.0.16.0
    . Java JDK 1.6.0_12-b04
    Please, if someone could give me a lead, I would appreciate very much!
    Thank you all in advance,
    CaioToOn!

    ejp wrote:
    Thank you for the answer, but no. The path is correct.That's not what he meant. Zip file/directory entries are supposed to use / as the path separator. It is possible to use \ but such Zip files will only work under Windows. You may have erred here.Ohhh, I had really missunderstood what Ray said. But, I still think that this is not the problem, since the ZIP is a single SWF file generated by Flex SDK 3.4 and compressed in the ZLIB open standard (as in page 13, at [http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf|http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf] ). This is how Flash Compiler compress the files.
    jschell wrote:
    If the above suggestions do not solve the problem...Specify in detail with the exact steps used how you determined that it was corrupted.The reason why I believe the SWF is getting corrupted is that when it is loaded by Flash Player (in the client-side) the Player throws a VerifyError: Error # 1033. The [documentation says (see error 1033)|http://help.adobe.com/en_US/AS3LCR/Flash_10.0/runtimeErrors.html] that this error means that the SWF file is corrupted.
    As I said, what intrigues me is that this work perfectly in a Windows Server 2008 server. I just had setup a CentOS server and deployed the application. The client-remains unchanged, so why could the result change?
    raychen wrote:
    I would remove the side effect you are doing and send the file straight through, with decompress and compress, the servlet. It is more likely that you have a bug in your swf processor than the zip library.
    I had already tried it when first coding, in Windows Server 2008, it had not worked.
    Thank you all for the help.
    CaioToOn!

Maybe you are looking for

  • A function driver was not specified

    I cannot see my iPod in My Computer or iTunes. I get the message "The installation failed because a function driver was not specified for this device instance." when I re-boot after the iPod CD installation.   Windows 2000  

  • Not able to post a parked document in G/L

    I created a G/L document using FB50. After Simulating it I parked the document. When I try to post the document using FV50, the "Post" tab is not active in the parked document. Can anyone suggest how to post this parked document? Regards

  • Require Fields Before Printing

    I've been looking through the documentation of Adobe Live Cycle Designer and cannot find my answer. I have two fields, which I would like to be required. Upon a user pressing the print button, if these fields are empty, require it before the form wil

  • Tracking a person

    I have footage of a person with other people. I want to take the person, and get rid of his background. He moves from left to right. I used the Spline Tool, and created a shape. How do I have Motion continue to follow him as he moves?

  • Costcenter

    hi sap gurus, When i am clearing the document in f-44 i am getting error message as Cost center is blocked againest Dircet postings. Regards, Mallik.