Java Charset Problem

My application can works as web browser and renders html page into a Jeditorpane.However if I display a page in a different charset other than English it doesn't show the page at all.
My approach is construct a inputstreamreader using a charset used for that page and then use HTMLEditorKit.read(reader,htmldoc,0) to read the content into htmldoc or use HTMLEditorKit.Parser class to parse the content into htmldoc. But both don't work.Anybody know how to work it out?

Well, everything you read in has got to be painted on the screen, so you either need code or fonts or images or something to print out non european characters

Similar Messages

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java Uninstall Problem

    Java Uninstall Problem
    This all came about because of a failed uninstall, using Your Uninstaller.
    The {Java runtime which is all I want) is not listed now & I tried all the other fix bad uninstall type features, all to no avail.} )
    When I DL & run the latest package (jxpiinstall-6u11-fcs-bin-b90-windows-i586-25_nov_2008.exe}
    & run it I get:
    1st message:
         "This software has already been installed on your computer.
         Would you like to install it?"
    If I say no, it exits.
    If I say yes, I get this second message:
         :This action is only valid for products that are currently installed."
    So Now I have no Java & have no idea what to do.
    Any help would be greatly appreciated.
    Thanks, Neuromancer23

    Sorry...after posting it i realized there was a more appropriate forum, of which it took quiet awhile to find.)
    Now that I know where to find the forum list I will never double-post again.
    I'll close the question if I can

  • [Gnome - GDM] Locale/Charset Problem

    Hi everybody,
    I´m using Gnome with GDM as Display Manager.
    I got a problem with my keyboard settings, but don´t know why
    The first charset/locale option is set in the /boot/grub/menu.lst
    kernel /vmlinuz26 lang=de locale=de_DE.UTF8 root=/dev.....
    I use a LUKS encrypted /home partition and need a german locale/charset for the passphrase/during bootup.
    The second charset option is in my /etc/rc.conf:
    LOCALE="de_DE.UTF8"
    KEYMAP="de"
    With those settings I got an almost "normal" keyboard behaviour.
    The Umlaut-Character for example arent´t working during bootup or in a tty. In a later started shell inside of Gnome everything works fine.
    The second charset problem is during password input inside GDM. The layout isn´t working right here either.
    I already tried the ./dmrc settings of Language and Keys, but nothing works.
    Anyone got a clue how to fix that?
    Greets
    Flo

    Maybe you can change the subject of this thread, as the issue is not only related to gdm, IMHO.
    I don't get it either. Settings are LOCALE="sv_SE"  and KEYMAP="sv-latin1" in rc.conf and locale -a gives me
    [root@localhost ~]# locale -a
    C
    POSIX
    sv_SE
    sv_SE.iso88591
    swedish
    But something is still wrong, because calling up some manpages gives me
    Cannot open the message catalog "man" for locale "sv_SE"
    (NLSPATH="<none>")
    I ran locale-gen, but I'm pretty lost in this locale business too...

  • Sun Java security problems

    Please any one tel me about Sun Java security problems
    with Desktop application

    Hi.
    If you're using SSGD 4.41, please download the Admin guide from here:
    http://docs.sun.com/app/docs/doc/820-4907
    There, at page #41 you'll find useful info concerning "Client Connections and Security Warnings".
    Hope this helps,
    Rob

  • OS X Lion - JAVA SCRIPT PROBLEM

    I recently updated from Snow Leopard to OS X Lion. Now I seem to have a JAVA Script problem. Where do I start fixing this issue. I have checked updates etc etc but it seems to be updated. However, when I login to my web site backend, I have a problem. Any advice please?

    Would you please write some more details? explain the problem and what web site backend you use. Thanks.

  • Charset problems using java applet.

    Im running a java applet where the text is displayed in a JEditorPane.
    When running the applet locally the charset is all fine, but when i push the applet into a webserver the charset is displayed incorrectly.
    Anyone have any thoughts why this can happen?

    Actually this was caused because I signed the jarfiles running on the server. Why does that happen?

  • Help! how to resolve the charset problem in Java developping

    I write a JDBC servlet to access oracle 7.2.3 database,
    and I use jdbc-thin driver,but when I insert a chinese record or
    query a record including chinese through a web form It looks like
    "???" and don't find the record.,I don't know if the driver
    doesn't support unicode.please help me!!
    null

    Fred Hou (guest) wrote:
    : I write a JDBC servlet to access oracle 7.2.3 database,
    : and I use jdbc-thin driver,but when I insert a chinese record
    or
    : query a record including chinese through a web form It looks
    like
    : "???" and don't find the record.,I don't know if the driver
    : doesn't support unicode.please help me!!
    We are dealing with the similar type of issues. Haven't figured
    it all out yet, but check and see if your database is set up to
    store asian characters. ??? mean that the database didn't know
    how to store the characters. My guess is that your database's
    character set is US7ASCII, and it needs to be a multi-byte
    character set.
    null

  • Mail attachment charset problem

    Hello,
    I have made a program which is able to send Icalendar files as an attachment. I get the data as an InputStream.
    My problem is that the Icalendar file doesn�t show the letters '�', '�' and '�'. I have tried to use iso-8859-1 in the MimeBodyPart headerline and in the ByteArrayDataSource, but it doesn�t work?!
    Where can I specify which charset I want to use?
    MimeBodyPart mbp3 = new MimeBodyPart();
    mbp3.setFileName( m.getAttachmentFileName() );
    mbp3.setHeader("Content-Class", "urn:content-classes:calendarmessage");
    mbp3.setHeader("Content-ID","calendar_message");
    mbp3.addHeaderLine("charset=iso-8859-1");
    java.io.InputStream inputStream = null;
    try {
          inputStream = m.getAttachmentFile().getBinaryStream();
          mbp3.setDataHandler( new DataHandler( new javax.mail.util.ByteArrayDataSource( inputStream, "text/calendar;charset=iso-8859-1;method=REQUEST" ) ) );
    catch ( Exception e ){}
    mpRoot.addBodyPart(mbp3);

    Yes you are right... Thank you.
    I removed the line:
    mbp3.addHeaderLine("charset=iso-8859-1"); - and now the letters are shown correct when opening the ICalendar file using a text editor.
    But when openning the file using Outlook the letters '�', '�', '�' are removed?! I know that isn�t a problem in my mail code but certainly in the iCal file?!

  • JSP, Javabean charset problem

    I have some JSP pages where I try to dynamically present some drop-down
    menus for the users to select values. I use a simple bean to manage it.
    The problem is that those values are in non-iso8859-1 charset and I only
    get ?????? rendered in the select box. I define an array (inline in the
    JSP page as code scriptlet), write all possible (String) options for the
    drop-down menu there and in the bean I do some calculations and render
    the drop-down menu.
    String label[]={"something in iso-8859-7 encoding in here","something in
    iso-8859-7 encoding in here","something in iso-8859-7 encoding in here"};
    and in the bean I have a for-loop to access this.
    The page directive is set to iso-8859-7.
    I think there is some kind of transparent translation, that has to do
    with Java language, and after the rendering I only get ???? instead of
    the correct iso-8859-7 value in the browser.
    Any help appreciated.
    (Tomcat, Apache web server, JDK 1.3,)
    PS: This JSP page is used to submit some data in an Oracle database
    (according to the selection of the user in the drop-down box), so I also
    use JDBC 1.3, but I don't think that's relevant at all with my problem...
    null

    I have some JSP pages where I try to dynamically present some drop-down
    menus for the users to select values. I use a simple bean to manage it.
    The problem is that those values are in non-iso8859-1 charset and I only
    get ?????? rendered in the select box. I define an array (inline in the
    JSP page as code scriptlet), write all possible (String) options for the
    drop-down menu there and in the bean I do some calculations and render
    the drop-down menu.
    String label[]={"something in iso-8859-7 encoding in here","something in
    iso-8859-7 encoding in here","something in iso-8859-7 encoding in here"};
    and in the bean I have a for-loop to access this.
    The page directive is set to iso-8859-7.
    I think there is some kind of transparent translation, that has to do
    with Java language, and after the rendering I only get ???? instead of
    the correct iso-8859-7 value in the browser.
    Any help appreciated.
    (Tomcat, Apache web server, JDK 1.3,)
    PS: This JSP page is used to submit some data in an Oracle database
    (according to the selection of the user in the drop-down box), so I also
    use JDBC 1.3, but I don't think that's relevant at all with my problem...
    null

  • Charset problem!!

    Hello everybody, there is something i need help with..
    I have xml files, created by me in java, i create xml files in different charsets. The problem is when i try to read a UTF-8 File, with :
    StreamSource sts=new StreamSource(new BufferedReader(new InputStreamReader(new FileInputStream(filename),"UTF-8")));when i read a ISO-8859-1 file, it works fine, but with a UTF-8 is seems to be a problem, cause i get a error parsing the xml, but if i use :
    StreamSource sts=new StreamSource(filename);it works for UTF-8, but not for ISO, (i think UTF-8 is java's default)..
    so, any ideas??

    If you pass the XML parser an InputStream or
    something else where it can read the bytes, it will
    get things right. (Assuming the XML declares its
    encoding correctly.) If you pass the XML parser a
    Reader where you apply the wrong encoding, the parser
    will not be able to get things right. Choose one of
    those two.That's why i used:
    StreamSource sts=new StreamSource(new BufferedReader(new InputStreamReader(new FileInputStream(filename),"UTF-8")));I read that InputStreamReader is the best way to read characters well using a given encoding.

  • Can't get file size, possibly because of charset problem

    I have an application that needs to recursively find directory sizes, I have a class extending java.io.File with an internal method to do this:
    private static long getSize(File file) {
                    long size = file.length();
                    if (file.exists()) {
                            if (file.isDirectory()) {
                                    File[] files = file.listFiles();
                                    for (int i = 0; i < files.length; i++) {
                                            size += getSize(files);
    } else {
    System.out.println("Problem checking size on \"" + file + "\", reported file size is: " + file.length());
    return size;
    It works (matches du -b output) with the exception of some problematic files I have.
    Output from ls:
    $ ls -l
    total 5461
    -rw-r--r--  1 xyz users    1003 Feb 16 22:06 FileWRS.class
    -rw-r--r--  1 xyz users     831 Feb 16 22:04 FileWRS.java
    -rw-r--r--  1 xyz users     489 Feb 16 22:07 FolderSizes.class
    -rw-r--r--  1 xyz users     198 Feb 16 21:23 FolderSizes.java
    -rwxrwxrwx  1 xyz users 5568138 Apr 25  2004 test.?.abcOutput from du -b:
    $ du -b
    5583203 .Output from my code:
    $ java FolderSizes .
    Problem checking size on "./test.?.abc", reported file size is: 0
    15065The character displaying as "?" is actually an accented e character ("�") and displays correctly in konqueror (my gui file browser).
    I don't really know why it can't pick up the character, but I'm more interested in just getting the file size and ignoring the character problem, any solutions/suggestions for places to look? Do I need to supply more information?

    Try:
    LC_ALL=en_US.ISO8859-1 java FolderSizes .
    Does this help?Yes, that does fix it for my terminal, but if possible I would like a solution that can determine this at run time and solve (so that when it's running on some other terminal, with some other charset, with someother file system charset it will still work).
    Any ideas for doing this from withing the VM?
    p.s. thanks for the fast reply.

  • Default Java Charset

    Hello:
    I have a problem sending mail from a web application; when it's run from my desktop it sends mail OK, but when it's run from the server it sends messages with accents ant other signs garbled (in the body and in the Subject line).
    I've been investigating and saw that the difference between the same message sent from the two machines is that one is encoded with "quoted-printable" when the other is "7bit". After more investigations I think I compose the mail correctly, but then I used "MimeUtility.getDefaultJavaCharset()" and discovered that my machine gets "ISO-8859-15" while the server gets "US-ASCII". Both are linux machines, and they have the "es_ES@euro" locale set. I've discarded too the encoding of the text file from which I get the text of the body, because I test always with three files (they have the same content, but one is encoded in UTF8, other in ISO-8859-1 and the other in ISO-8859-15).
    So the problem seems to me that is reading the file; if JVM in the server runs in US-ASCII meybe it can't read the file correctly, so it won't get correctly encoded in the mail no matter what I do.
    The question is: How can I change the Java Default Charset in the server? Or, how can I read the file correctly no matter what the Java Default Charset is?
    Thank you in advance.

    Well, at least I can send now the text correctly encoded, although it now encodes it with "base64" instead of "quoted-printable", which is what I intended... Anyway, here's the code I use to read the text file forcing the charset:
    BufferedReader lectorFichero=new BufferedReader(new InputStreamReader(new FileInputStream(nombreFichero),"ISO-8859-15"));
    StringBuffer bufferTextoFichero=new StringBuffer();
    int i;
    while((i=lectorFichero.read())!=-1) bufferTextoFichero.append((char)i);
    lectorFichero.close();
    String textoFichero=bufferTextoFichero.toString();(Thanks to Dr. Heinz M. Kabutz; http://www.roseindia.net/javatutorials/using_unicode_variable_names.shtml)

  • Adobe Dreamweaver CS5.5 - Windows 7 - Java Script Problem

    I am having trouble with Anchor.htm.
    When I try to insert an anchor in the text (Insert > Named Anchor> I get this error message:
    "While executing insertObject in Anchor.htm a Java Script error occurred."
    I recently downloaded both the 32- and 64-bit Java Script applications when I received a message that the existing version of Java Script was out-of-date. Anchor.htm worked before I installed the update.
    The files I downloaded and installed are:
    jre-7u9-windows-i586.exe
    jre-7u9-windows-x64.exe
    Please can anyone help me with this problem?

    From Dreamweaver FAQ
    http://forums.adobe.com/thread/429114
    "If Dreamweaver is acting erratically, or if you see a message saying "the following JavaScript error(s) occurred",  it's usually a sign of a corrupt cache file. The first thing to try should always be to delete the file cache. If that doesn't work, delete your personal Configuration folder. Full instructions are in Deleting a corrupted cache file.
    http://forums.adobe.com/thread/494811"
    Nancy O.

Maybe you are looking for

  • Exporting keys as ascii text

    How can you export a key as ascii text like an armored key in PGP? But not using PGP?

  • Sound Cuts Out

    Hi All, I am having some problems with the sound on my iPhone 4. When i play music or video using the speakers, sometimes the sound is there and others it isnt. when i finally get the sound on (After randomly pressing all of the volume buttons) it pl

  • Interference between mutliple SSLSocket

    Hello, I wrote a client and a server applications using SSLSocket and Channels. A single communication from client to server is Ok but if a second connection is made by the same client, there is interference between both connection. The first input c

  • Re-importing a lost book from pdf

    Hello. About 2 years ago the mover dropped my iMac and pooched my drive. After a new drive was installed I was able to recover all my photo's but never any of the projects (Calendars, Books etc.) Now I wish to reprint a book I made, but no longer hav

  • Downloading Albums as Playlists

    After years of downloading single songs from iTunes, today I downloading an entire album.  I thought that a Playlist would be created for this album, but itwasn't.  So I manually created a playlist with the album name and then added all the songs.  I