JSPs with UTF-8 coding

Dear all,
I've got a problem in using JDeveloper 3.2.2 to write a JSP to connect to Oracle 8i database and display the query result.
The database has been set to support UTF-8, and I've set the Encoding property of the complier of the project to "UTF-8". I included <%@ page contentType="text/html;charset=UTF-8"%> at the top of my JSP and <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> inside the <Head> tags, but when I try to run under the JDeveloper, it fail to show the correct Chinese Characters, it shows some symbols...
Is there any setting I've missed?
Thanks
LeeKit

j2ee_ubuntu wrote:
//BufferedReader fileReader = new BufferedReader(new FileReader(file)); //replace this with given below
BufferedReader fileReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
Nice spoon-feeding there. I assure you that the OP has learned exactly nothing now.

Similar Messages

  • Problem with UTF-8 japanese on Win XP

    Hi,
    I have a Client/server application with a server coded in C++ and runing on HP workstation and the GUI in java runing in a web context via java webstart mechanism on PC machine with win XP sp2 OS.
    when logging into the HP workstation in japanese SHIFT_JIS and downloading the application japanese Charcters are displayed correctly on my PC.
    However when logging into the HP workstation in japanese with UTF-8 encodage and kaunching the application characters aren't displayed correctly only rectangle charcaters are displayed, when launching the GUI on HP workstation it displayed correctly.
    Can any one help me to resolve this problem.
    Regards,

    Both SHIFT_JIS and UTF-8 are character encodings. SHIFT_JIS encodes a superset of JISX-0208 to double-byte codepoints and JISX-0201 to single byte codepoints. UTF-8 encodes all of Unicode.
    The problem here is that you are relying on "default" encoding for a client-server application. This only works when the default encoding is the same on both ends.
    Go through your code, looking for everywhere where you convert to and from Strings, including reading and writing to IO Streams, and replace the methods you are using with equivalent methods that let you specify an encoding.

  • XML, XSL - HTML(JSP), bad UTF-8 encoding on Tomcat

    I use simple transformation to create HTML (JSP) page from XML, XSL (both are encoded in UTF-8}. When doing this in embedded web server in JD9i developer, the result is fine. But when run at Tomcat 4.0.3, UTF-8 chars are displayed as 2 characters. It's interesting that the transformation gives different results:
    - in JD9i the UTF-8 chars are left unchanged and shown good in IE browser
    - in Tomcat the chars with acute (/) are transformed into "&iacute;" , "&aacute;" and so on and shown properly, whereas chars with caron (V) are encoded and shown badly.
    Does somebody know solution to this ? Thanks.

    Doing some more experiments reveals a subtle difference between GET and POST with Tomcat - it may apply to other application servers, but I have only tested with Tomcat 5 and Tomcat 6, so I can't say.
    The following is essentially what most people have indicated you need to do to have your JSP handle UTF-8:
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>My Title</title>
    </head>
    <body>
    </body>
    </html>This is what I couldn't get working with my GET (the default for forms) and ended up working when I specified the URIEncoding for the connector in the server.xml file.
    It turns out that the above will work with no modifications to the server.xml file if the form method is POST. If you need to be able use GETs then you will need to modify the connector, otherwise it would seem nothing you do at the JSP or servlet level will make a difference, unless you want to convert each parameter manually:
      String parameter = new String( request.getParameter("myParam").getBytes("ISO-8859-1"), "UTF-8" );Edited by: ajmasx on Sep 27, 2007 10:20 AM

  • Reading using UTF-8 coding

    hi
    I am trying to read an Arabic text from textfile and copy it to another file, using UTF-8 coding, I saved the file in UTF-8 conding , but I get a result with strange charachters.
    this is the code
    * @Program that returns a Unicode string.
    * ReadUTF.java
    * Author:-RoseIndia Team
    * Date:-07-jun-2008
    import java.io.*;
    public class ReadUTF {
    public static void readArabic(String filename, String outFile ){
    try{
    File file = new File(filename);
    BufferedReader fileReader = new BufferedReader(new FileReader(file));
    BufferedWriter fileWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8"));
    String str;
    while ((str = fileReader.readLine()) != null) {
    fileWriter.write(str);
    fileWriter.newLine();
    System.out.println(str);
    fileReader.close();
    fileWriter.flush();
    fileWriter.close();
    catch(IOException e){
    e.printStackTrace();
    public static void main(String[] args)throws IOException {
    readArabic("arabi.txt", "Arabia2.txt");
    } //======================================
    this is what I am sopose 2 get
    HomeNewsSportRadioTVWeatherLanguages
    &#1606;&#1589;&#1608;&#1589; &#1601;&#1602;&#1591;
    &#1570;&#1582;&#1585; &#1578;&#1581;&#1583;&#1610;&#1579;: &#1575;&#1604;&#1571;&#1585;&#1576;&#1593;&#1575;&#1569; 15 &#1571;&#1603;&#1578;&#1608;&#1576;&#1585; 2008 09:24 GMT
    &#1571;&#1581;&#1583;&#1579; &#1575;&#1604;&#1571;&#1582;&#1576;&#1575;&#1585;
    &#1608;&#1575;&#1588;&#1606;&#1591;&#1606; &#1608;&#1575;&#1579;&#1602;&#1577; &#1605;&#1606; &#1575;&#1604;&#1578;&#1608;&#1589;&#1604; &#1604;&#1575;&#1578;&#1601;&#1575;&#1602; &#1571;&#1605;&#1606;&#1610; &#1605;&#1593; &#1575;&#1604;&#1593;&#1585;&#1575;&#1602;
    &#1593;&#1580;&#1586; &#1575;&#1604;&#1605;&#1610;&#1586;&#1575;&#1606;&#1610;&#1577; &#1575;&#1604;&#1571;&#1605;&#1585;&#1610;&#1603;&#1610;&#1577; &#1578;&#1590;&#1575;&#1593;&#1601; &#1579;&#1604;&#1575;&#1579; &#1605;&#1585;&#1575;&#1578;
    &#1602;&#1605;&#1577; &#1576;&#1585;&#1608;&#1603;&#1587;&#1604; &#1575;&#1604;&#1571;&#1608;&#1585;&#1608;&#1576;&#1610;&#1577; &#1578;&#1576;&#1581;&#1579; &#1575;&#1604;&#1571;&#1586;&#1605;&#1577; &#1575;&#1604;&#1605;&#1575;&#1604;&#1610;&#1577;
    &#1587;&#1608;&#1585;&#1610;&#1577; &#1608;&#1604;&#1576;&#1606;&#1575;&#1606; &#1610;&#1593;&#1604;&#1606;&#1575;&#1606; &#1585;&#1587;&#1605;&#1610;&#1575; &#1576;&#1583;&#1569; &#1575;&#1604;&#1593;&#1604;&#1575;&#1602;&#1575;&#1578; &#1575;&#1604;&#1583;&#1576;&#1604;&#1608;&#1605;&#1575;&#1587;&#1610;&#1577;
    &#1608;&#1586;&#1610;&#1585; &#1575;&#1604;&#1582;&#1575;&#1585;&#1580;&#1610;&#1577; &#1575;&#1604;&#1604;&#1576;&#1606;&#1575;&#1606;&#1610; &#1608;&#1606;&#1592;&#1610;&#1585;&#1607; &#1604;&#1587;&#1608;&#1585;&#1610; &#1610;&#1608;&#1602;&#1593;&#1575;&#1606; &#1601;&#1610; &#1583;&#1605;&#1588;&#1602; &#1593;&#1604;&#1609; &#1576;&#1610;&#1575;&#1606; &#1610;&#1593;&#1604;&#1606; &#1576;&#1583;&#1569; &#1575;&#1604;&#1593;&#1604;&#1575;&#1602;&#1575;&#1578; &#1575;&#1604;&#1583;&#1576;&#1604;&#1608;&#1605;&#1575;&#1587;&#1610;&#1577; &#1576;&#1610;&#1606; &#1587;&#1608;&#1585;&#1610;&#1577; &#1608;&#1604;&#1576;&#1606;&#1575;&#1606; &#1575;&#1593;&#1578;&#1576;&#1575;&#1585;&#1575; &#1605;&#1606; &#1575;&#1604;&#1610;&#1608;&#1605;.
    &#1575;&#1578;&#1601;&#1575;&#1602; &#1587;&#1608;&#1585;&#1610; &#1604;&#1576;&#1606;&#1575;&#1606;&#1610; &#1593;&#1604;&#1609; &#1578;&#1585;&#1587;&#1610;&#1605; &#1575;&#1604;&#1581;&#1583;&#1608;&#1583;
    &#1578;&#1593;&#1604;&#1610;&#1602;&#1575;&#1578;&#1603;&#1605;: &#1587;&#1608;&#1585;&#1610;&#1577; &#1578;&#1602;&#1610;&#1605; &#1593;&#1604;&#1575;&#1602;&#1575;&#1578; &#1583;&#1576;&#1604;&#1608;&#1605;&#1575;&#1587;&#1610;&#1577; &#1605;&#1593; &#1604;&#1576;&#1606;&#1575;&#1606;
    //==============================
    and here What the compiler gives me
    HomeNewsSportRadioTVWeatherLanguages
    ?ص?ص ??ط
    آخر ت*د?ث: ا?أربعاء 15 أ?ت?بر 2008 09:24 GMT
    أ*دث ا?أخبار
    ?اش?ط? ?اث?ة ?? ا?ت?ص? ?ات?ا? أ??? ?ع ا?عرا?
    عجز ا???زا??ة ا?أ?ر???ة تضاع? ث?اث ?رات
    ??ة بر??س? ا?أ?ر?ب?ة تب*ث ا?أز?ة ا??ا??ة
    س?ر?ة ??ب?ا? ?ع??ا? رس??ا بدء ا?ع?ا?ات ا?دب???اس?ة
    ?ز?ر ا?خارج?ة ا??ب?ا?? ??ظ?ر? ?س?ر? ???عا? ?? د?ش? ع?? ب?ا? ?ع?? بدء ا?ع?ا?ات ا?دب???اس?ة ب?? س?ر?ة ??ب?ا? اعتبارا ?? ا????.
    ات?ا? س?ر? ?ب?ا?? ع?? ترس?? ا?*د?د
    تع???ات??: س?ر?ة ت??? ع?ا?ات دب???اس?ة ?ع ?ب?ا?
    Can anyone please figure out what is the problem ?

    j2ee_ubuntu wrote:
    //BufferedReader fileReader = new BufferedReader(new FileReader(file)); //replace this with given below
    BufferedReader fileReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
    Nice spoon-feeding there. I assure you that the OP has learned exactly nothing now.

  • Java: Loading Resource Bundle File with UTF-8

    I have found out all my previous problems now, thank you all for your assitance with this...
    During the time we have worked so solve our problem with UTF-8 charset we have found new problem with this?
    I don't know if this is the right forum to put this up, if not please let us know where to go with this?
    I have prepared both Eclipse (JSP Files) and GlassFish to run all my files in charset UTF-8. Then i got my
    resource bundle files(property files) to use UTF-8 encoding. Everything looks fine in my text editor. Then
    when i upload these pages every character retrieved from my resource bundles look garbled. This is because
    Java loads property files using ISO 8859-1 character encoding.
    This is a problem from Sun i have read on the internet!
    Note: that in JDK 1.6, you can use PropertyResourceBundle constructor to take a Reader which uses UTF-8 encoding.
    please have a look at these links for more info:
    [http://www.kai-mai.com/node/128]
    [http://java.sun.com/javase/6/docs/api/java/util/PropertyResourceBundle.html]
    Note: PropertyResourceBundle can be constructed either from an InputStream or a Reader, which represents a property file.
    Constructing a PropertyResourceBundle instance from an InputStream requires that the input stream be encoded in ISO-8859-1.
    In that case, characters that cannot be represented in ISO-8859-1 encoding must be represented by Unicode Escapes,
    whereas the other constructor which takes a Reader does not have that limitation.
    What i have read and understand is that the real solution to the problem is: Get the fmt lib to use a Reader instead of an
    InputStream. Alternativly if it works get a ResourceBundle instead of creating one that is wrong all the time? I have to create
    my own ResourceBundle instead of using my own fmt lib wich i cannot trust in a way any more. Is this right or am i comletly wrong?
    My WebTexts files, en, sv and ry are my resource property bundles. To be able to read them i will use resource property bundle reader.
    Fmt lib gives me this but it seems that it inciates this in an InputStream (wich is looked to iso-8859-1) instead of a reader who can
    read UTF-8 without no problem. So can i get my fmt lib to change this or not, anybody have an idea about this???

    Torleif wrote:
    Ok, i know there are a few ways of doing this already. The problem is that i have no idea how to use these different problem solving issues. First we have the;
    1. native2ascii command line utility.
    2. use the XML properties format.
    3. other ways of converting from iso-8859-1 to utf-8.
    The last one i have tried already but i never get this to work. So after knowing of 2 standardized solutions you choose to implement your own non-standard soltion? That's usually not a good idea until you've verified that the standardized solution don't help.
    This is also not the best solution to the problem i have to say. This way i will have both properties files and source files to work with and that is to much i think. Either i will use the native2ascii command or use XML properties format like you say here. I need some more insight in how these two work only because i have no idea my self.Uhm .. read [the documentation|http://java.sun.com/javase/6/docs/api/java/util/Properties.html]? loadFromXML/storeToXML work pretty much exactly the same as load/store, except they handle XML. Try it, look at what it produces, learn.
    Could you please help and explain how to use either this native2ascii command line work or how this XML format properties would work for me. Please i need guidance here with this!!![native2ascii is documented as well|http://java.sun.com/javase/6/docs/technotes/tools/windows/native2ascii.html].
    If you have a specific question after reading those, feel free to ask here.
    You really have to work on your Google-fu, it seems to be too weak.

  • Page directive with UTF-8 charset??

    Hello,
              I try to implement the following jsp with weblogic. It displays A???C on the
              browser when the encoding is set to Unicode(UTF-8).
              When I change the browser encoding to Western European, it works fine.
              <html>
              <head>
              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
              <title>Trying</title>
              </head>
              <body>
              <%
              String original = new String("A" + "\u696D" + "\u00f1" + "\u00fc" + "C");
              byte[] utf8bytes = original.getBytes("UTF8");
              String roundTrip = new String(utf8bytes, "UTF8");
              %>
              Original = <%=original %>
              RoundTrip = <%=roundTrip %>
              </body>
              </html>
              I found that it ignores the first two 00 when handle \u00xx character.
              However, if I add the following page directive at the beginning, it works
              fine.
              <%@ page contentType="text/html; charset=UTF-8" %>
              My question are
              1. why it trim the first two digit ("00")?
              2. what the weblogic did when I add the page directive?
              3. Is that mean the line <meta http-equiv.....> cannot work?
              4. Is there any alternative instead of adding the page directive line?
              I use WL6.1, win2000. Please help.
              Thanks a lot.
              Regards,
              kfchu
              

    String original = new String("A" + "\u696D" + "\u00f1" + "\u00fc" + "C");          > I found that it ignores the first two 00 when handle \u00xx character.
              > 1. why it trim the first two digit ("00")?
              I can't tell what you mean. According to the JLS, the "\uxxxx" construct is
              processed in a pre-lexical step. That means that your code is the same as
              writing:
              String original = new String("A" + "?" + "?" + "?" + "C");
              (Where I used a question mark instead of looking up and writing in the
              actual character values.)
              The reason why it is 00xx is that the "\u" construct requires the data in
              UTF16 format (the 2-byte encoding of Unicode characters which you know as
              Java's "char" type).
              To see how this data is encoded / decoded, you can look at the Java sources
              for java.io.DataInputStream and DataOutputStream.
              > 4. Is there any alternative instead of adding the page directive line?
              Yes! You can use the Response method directly:
              public void setContentType(java.lang.String type)
              (That's all that the JSP does anyway.)
              Peace,
              Cameron Purdy
              Tangosol Inc.
              Tangosol Coherence: Clustered Coherent Cache for J2EE
              Information at http://www.tangosol.com/
              "kfchu" <[email protected]> wrote in message
              news:[email protected]...
              > Hello,
              >
              > I try to implement the following jsp with weblogic. It displays A???C on
              the
              > browser when the encoding is set to Unicode(UTF-8).
              > When I change the browser encoding to Western European, it works fine.
              > ---------------------------------
              > <html>
              > <head>
              > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
              > <title>Trying</title>
              > </head>
              > <body>
              > <%
              > String original = new String("A" + "\u696D" + "\u00f1" + "\u00fc" + "C");
              > byte[] utf8bytes = original.getBytes("UTF8");
              > String roundTrip = new String(utf8bytes, "UTF8");
              > %>
              > Original = <%=original %>
              > RoundTrip = <%=roundTrip %>
              > </body>
              > </html>
              > -----------------------------------
              >
              > I found that it ignores the first two 00 when handle \u00xx character.
              > However, if I add the following page directive at the beginning, it works
              > fine.
              > <%@ page contentType="text/html; charset=UTF-8" %>
              >
              > My question are
              > 1. why it trim the first two digit ("00")?
              > 2. what the weblogic did when I add the page directive?
              > 3. Is that mean the line <meta http-equiv.....> cannot work?
              > 4. Is there any alternative instead of adding the page directive line?
              >
              > I use WL6.1, win2000. Please help.
              >
              > Thanks a lot.
              >
              > Regards,
              > kfchu
              >
              >
              

  • Char into balise jsp:scriptlet in jsp with xml syntax

    hello,
    i met a trouble with coding jsp with xml syntax,
    i use wsad to develop the jsp, and it's not allowed to put characters < or > into the balise scriptlet
    for example i cant do a loop (as i did easily with html syntax <% %> ) :
    this his the header of my jsp:
    <jsp:directive.page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" />
    <jsp:text>
    <![CDATA[ <?xml version="1.0" encoding="ISO-8859-1" ?> ]]>
    </jsp:text>
    <jsp:text>
    <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> ]]>
    </jsp:text>
    and the code which dont work:
    <jsp:scriptlet>
    for (int i=0;i<10;i++){
    System.out.println(i);
    </jsp:scriptlet>
    i get a compilation error, did someone could help me to code dynamic content jsp ?
    ps: excuse me for my english.

    I don't use xml, so I may be way off the wall, but did you try using the CDATA sections again?
    <jsp:scriptlet>
    <![CDATA[
    for (int i=0;i<10;i++){
    System.out.println(i);
    ]]>
    </jsp:scriptlet>

  • Error while running JSP with custom tag

    I am trying to run a jsp with a tag and I am getting the following error when I run the jsp:
    "Unable to open taglibrary /WEB-INF/jsp/mytaglib.tld : Parse Error in the tag library descriptor: External parameter entity "%(DOCTYPE);" has characters after markup."
    I have no idea what this is, can anyone help me here?
    tx
    -AB

    Its difficult to tell without looking at your TLD file i.e. mytaglib.tld
    However, a guess is that you may be refering to an invalid or otherwise corrupted DTD from your TLD.
    Check that out.
    The official DTD for TLDs in JSP 1.1 is http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
    and the official DTD for TLDs in JSP 1.2 is http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd

  • Message Mapping Problem with UTF-16LE Encoded XML

    Hello,
    we have the following scenario:
    IDoc > BPM > HTTP Sync Call > BPM > IDoc
    Resonse message of the HTTP call is a XML file with UTF-16LE processing instruction. This response should then be mapped to a SYSTAT IDoc. However the message mapping fails "...XML Parser: No data allowed here ...".
    So obviously the XML is not considered as well-formed.
    When taking a look at SXMB_MONI the following message appears: "Switch from current encoding to specific encoding not supported.....".
    Strange thing however is if I save the response file as XML and use the same XML file in the test tab message mapping is executed successfully.
    I also tried to use a Java Mapping to switch encodings before executing message mapping, but the error remains.
    Could the problem be, that the codepage UTF-16LE is not installed on the PI system ? Any idea on that ?
    Thank you!
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM

    Hi,
    thank your for your answer.
    This is what I have tried to achieve. I apply the java conversion mapping when receiving the response message - i tried to convert the response to UTF-16, UTF-8 but none of them has helped to solve the problem.
    I guess that using adapter modules is not an option either as it would modify the request message, but not the response, right?

  • How to write csv or txt file through utl_file with UTF-8 Encoding

    Hi All,
    I need your help to write the data from DB to csv or txt file with UTF-8 encoding through utl_file.
    Database character set:AL32UTF8
    Database version:10G
    All the columns in the DB are of varchar2 type.
    Please let me know if there is any way of doing it.

    What was wrong with the info provided in the link(s) given?
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions027.htm#SQLRF00620]

  • [SOLVED] Problems opening folders with UTF-8 encoded characters

    Hello everyone, I'm having an issue when I acess folders in all my programs ( except Dolphin File Manager). Every time I open the folder navigation window in my programs, folders with UTF-8 encoded characters ( such as "ç", "á ", "ó", "í", etc ) are not shown or the folder name not show these characters, therefore, I can not open documents inside these folders.
    However, as you saw, I can type these characters normally. Here's my "locale.conf" :
    LANG="en_US.UTF-8:ISO-8859-1"
    LC_TIME="pt_BR.UTF-8:ISO-8859-1"
    And here's the output of the command "locale -a" :
    C
    en_US.utf8
    POSIX
    Last edited by regmoraes (2015-04-17 12:55:19)

    Thing is, when I run locale -a, I get
    $ locale -a
    C
    de_DE@euro
    de_DE.iso885915@euro
    de_DE.utf8
    en_US
    en_US.iso88591
    en_US.utf8
    ja_JP
    ja_JP.eucjp
    ja_JP.ujis
    ja_JP.utf8
    japanese
    japanese.euc
    POSIX
    So an entry for every locale I have uncommented in my locale.conf. Just making sure, by "following the steps in the beginner's guide", you also mean running locale-gen?
    Are those folders on a linux filesystem like ext4 or on a windows (ntfs?)

  • [svn:fx-trunk] 7661: Change from charset=iso-8859-1" to charset=utf-8" and save file with utf-8 encoding.

    Revision: 7661
    Author:   [email protected]
    Date:     2009-06-08 17:50:12 -0700 (Mon, 08 Jun 2009)
    Log Message:
    Change from charset=iso-8859-1" to charset=utf-8" and save file with utf-8 encoding.
    QA Notes:
    Doc Notes:
    Bugs: SDK-21636
    Reviewers: Corey
    Ticket Links:
        http://bugs.adobe.com/jira/browse/iso-8859
        http://bugs.adobe.com/jira/browse/utf-8
        http://bugs.adobe.com/jira/browse/utf-8
        http://bugs.adobe.com/jira/browse/SDK-21636
    Modified Paths:
        flex/sdk/trunk/templates/swfobject/index.template.html

    same problem here with wl8.1
    have you sold it and if yes, how?
    thanks

  • Working with UTF-8 text files as if they were ANSI?

    I have a text file saved in UTF-8, containing several characters from different languages. It's created in Notepad.
    I want to read that file into my Java application, which before only was used with regular ANSI .txt files.
    When showing the contents of the file on the screen (Swing GUI), the text is totally distorted. The application obviously doesn't understand from the beginning that the text file is encoded with UTF-8.
    Somehow I must convert the information in the file so that
    1) I can process the UTF-8 text in all String functions as if it were common ANSI text, and
    2) I can show the contents of those Strings on the screen in my Java application, and making it look like it should, whether it's English or Russian.
    Does anyone here have any tips or code samples that I can use?
    Thanks

    That is kind of what I'm trying to find out, how to read the file...
    When I read a text file that is saved as UTF-8, the letters don't show properly on the screen. Instead of, for example, a Pi symbol I would get a ?� or something.
    Though if I hardcode a String object that contains "\u0030" or a similar Unicode character, it shows properly.
    How do you read in the file???
    When you read in the file, you have to take the
    encoding into account.
    Take a look at InputStreamReader. This class allows
    you to specify the character encoding you will use.

  • [Solved] Automount Generic MP3 Player with UTF-8 encoding

    Hello, everybody!
    Ubuntu refugee here.
    So far I'm going fine with Arch, I just have a couple of problems related to my Generic USB Mp3 player:
    1) I want HAL to mount the player with UTF-8 encoding. Right now, it shows Arabic characters as ??????.
    2) In Ubuntu, it used to recognize the player as an MP3 player, give it a nice icon, and add it as a music source in Rhythmbox. In Arch, on the other hand, the player is mounted as a generic USB flash drive. How can I make Arch recognize it as an MP3 player?
    Thanks in advance.
    Last edited by farghal (2008-05-10 20:17:09)

    GOT IT WORKING!! Yay!
    I got the solution from here:
    http://blog.pcode.nl/2006/08/24/introdu … io-player/
    The trick is to make HAL identify your Digital Audio Player (DAP) by adding a rule to /usr/share/hal/fdi/information/10freedesktop/10-usb-music-players.fdi  --  and since, in my case, Ubuntu already had a 10-usb-music-players.fdi file that recognized my player, all I had to do was boot up from an Ubuntu live cd and copy Ubuntu's 10-usb-music-players.fdi over Arch's.
    Now my issues with Arch are down to only one: http://bbs.archlinux.org/viewtopic.php?pid=360647
    Thanks everybody.
    Last edited by farghal (2008-05-10 20:16:49)

  • Problem in connecting JSP with Oracle 9i.

    Hi,
    I am having problem in connecting JSP with Oracle 9i.
    I am using windows XP and my JDK version is 1.4. For executing JSP I am using
    "jakarta-tomcat-5.5.4-preconfigured". My database name is global.
    I have set java_home, j2ee_home, oracle_home, path, classpath as follows:
    j2ee_home=c:\sun\appserver
    java_home=c:\sun\appserver\jdk
    oracle_home=C:\oracle\ora92
    path=C:\Sun\AppServer\bin;C:\Sun\AppServer\jdk\bin;C:\oracle\ora92\bin
    classpath=C:\Sun\AppServer\lib\j2ee.jar;C:\oracle\ora92\jdbc\lib\ojdbc14.jar;C:\oracle\ora92\jdbc\lib\nls_charse
    t12.zip
    My code is as follows:
    <%@ page language="java" %>
    <%@ page import ="java.sql.*"%>
    <%
    try
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@global", "scott", "tiger");
    catch(SQLException e)
    out.println(""+e);
    out.println("Connected");
    %>
    I tried other program:
    <%@ page language="java" %>
    <%@ page import ="java.sql.*"%>
    <%
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:global","scott","tiger");
    out.println("Connected");
    %>
    I am getting following error:
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 5 in the jsp file: /jsp/oracle.jsp
    Generated servlet error:
    oracle.jdbc.OracleDriver cannot be resolved or is not a type
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:389)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Thanking you in advance,
    Anurag

    maneesh108 wrote:
    hi this is maneesh1) Read the thread it has been answered.
    2) The thread is very old. Don't resurrect old threads.
    I'm locking this zombie thread.
    Kaj

Maybe you are looking for

  • Can't receive  my mail on Mail

    Hello. I am using 10.3.9, and have been having a problem with Mail recently, that I would love to get some help with. Last week my Mail program stopped receiving mail for me on my desktop. (It still received spam, just nothing addressed to me). I can

  • Windows 8.1 and SQL Server 2012

    Let me set the environment.. I recently upgraded from Windows 8 Pro to Windows 8.1. Pro. Before the upgrade I was able to run a application that we use that has a SQL 2012 database connection. After the upgrade we are now getting this error "[DBNETLI

  • Applescript - Removing/adding keywords

    I'm trying to figure out how to add and remove hierarchical keywords from images using Applescript ... but I can't even figure out how to get the existing keywords. I started to play with this simple script (just to see what happens) and everything w

  • HT1296 When i try to sync my ipad with itunes on my computer it gives me an error message saying that the sync session failed to start."  How can i fix this??

    When i try to sync my ipad with the itunes on my computer it gives me an error message.  " The sync session failed to start.  How can i fix this??  I had to uninstall itunes on my computer because of runtime error R6034.

  • Event.MOUSE_LEAVE occassional TypeError thrown

    I'm seeing some odd errors with MOUSE_LEAVE in my debugger flash logs. See sample code below. I'll run this swf in a browser (OSX 10.5.3, Firefox 3.0, Flash Player 9.124d). I'm getting the 'leave' trace, but also occasionally get this error when swit