Problem with reading special characters in unix

Hi,
Iam trying to read the data from a file by the following code
FileInputStream inputFile = new FileInputStream(xx);
InputStreamReader reader = new InputStreamReader(inputFile);
BufferedReader bufferedReader = new BufferedReader(reader);
String s= bufferedReader.readLine();
one of the line in file has the character �
It working fine on windows, but on unix Iam getting it as ��.
I tried with InputStreamReader contructor which accepts the charset name also, like by giving Cp1252, and latin1 etc, but iam not able to get around this problem.
Any Ideas Please?

��This suggests to me that your input file is encoded in UTF-8. But that's only a guess, you need to find out for sure. Asking the person who produced the file would be the most reliable way. When you do find out, specify that encoding as the second parameter of the InputStreamReader constructor.

Similar Messages

  • Problem with Icelandic special characters on Mac

    Hello
    I am working on a Flash publication for students, and I want it to run on Mac as well as PC. Everything goes fine, except a problem with three special characters in my language, Icelandic. I am working on a registration and login page where I am using text boxes and text input boxes. Everything looks correct on PC, but on Mac the characters Þ Ð Ý are lost.
    I have tried different fonts etc.
    Any idea what is wrong?
    Jónas Helgason

    Hello Jónas,
    Did you ever figure this out ?
    I have a similar problem except only with two letters (both upper and lower case).  These two Icelandic letters can't be entered into a Flex TextInput box in the Flex apps I am creating when they are loaded on a Mac.  The letters are known as &Eth, &eth, &Thorn and &thorn in HTML terminology.  Typing these characters on the keyboard results in the following:  { [ ? /
    However I can copy the characters in question from some other app like TextEdit and paste them into a TextInput box in my Flex app and all is well, they show up correctly.
    This happens regardless of the Mac browser used and the Flash plugin version used (have tried both 9 and 10) and also happens in the standalone Flash Player application.
    Does anyone have any idea how to fix this or is this a bug in Flash Player ?  This is really annoying as it makes text input into Flex apps on Icelandic Macs very difficult.
    There must be something wrong with the mapping of keyboard key codes into character codes on the Mac that is causing this.
    Btw, I just heard from a friend that this problem does not exist in MacOS 10.6.  I am running 10.4 and have tested this on 10.5 and it exists on both of those OS versions.
    Rgds,
    Hordur Thordarson
    Lausn hugbunadur
    http://lausn.is

  • Spanish Dictionary and problems with spanish special characters

    I need a spanish dictionary, with all spanish words. I know that your priority are france, spanish, germany and Italy. So, the component has problems with spanish special words, this problem was notified before.
    Have you ready something? A new version?
    Thank you for your time.

    For the special character issue, you can check the reference:
    http://forums.adobe.com/message/2430501

  • Mysql problem with german special characters

    hi,
    I wrote a software and it worked quite good, but after I installed it on a new machine with j2se 1.4 I've problems with the german special characters.
    this code works good on the old machine (jdk 1.3.1) and prints the wanted characters like �,�,�.
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    java.sql.Connection conn;
    conn = DriverManager.getConnection("jdbc:mysql://localhost/testdb?user=testuser&password=xxxx");
    Statement s = conn.createStatement();
    ResultSet r = s.executeQuery("select something from testtb where id='1'");
    r.first();
    System.out.println( r.getString(1) );
    but on the new machine (j2se 1.4) I only receive the character ?.
    I updated my org.gjt.mm.mysql to the current MySQL Connector/J 3.0.9 and added
    conn = DriverManager.getConnection("jdbc:mysql://localhost/testdb?user=testuser&password=xxxx&useUnicode=true&characterEncoding=ISO-8859-1");
    but I've got still the same problem.
    Thanks in advance
    Markus

    with "wanted characters like �,�,�"
    I meant: like ä,ü,ö

  • Problem in reading special characters � Microsoft symbols.

    Hi All,
    I have a text field where user can enter some string and search. Unusually/unfortunately users can copy/paste text from ms-word file and search for that entry in the database. Here they can even copy ms-word special symbols such as ellipsis (�), em dash(�), en dash(�). Since database has such (special character) entries we cannot restrict them from doing this (after all that is the requirement).
    Now the problem is when I read the text value in servlet/jsp I find that those special characters are replaced by question marks(?). Because of this database return �no rows found� though there are entries.
    What I have observed is when I read the ASCII value � (int)char I am able to get proper value. Using that I am having if else block to replace the question marks with proper symbols. But is there a direct way to do this? I even tried converting the string to another character set type string. But no luck.
    (Also when I print the text value to a JSP, I can see proper vales through Internet Browser.)
    Below is the sample program(read_n_print.jsp), sysout prints question marks in console, but JSP/HTML shows proper value in browser.
    <html>
    <%
         String value = request.getParameter("special_text");
         System.out.println("value " + value);
         if(value != null){
              byte[] bytes= value.getBytes();
              try {
                   String output = new String(bytes,"ISO-8859-1");     
                   System.out.println("output " + output);     
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    %>
    <head>
    <title>Insert title here</title>
    </head>
    <body>
    <form method="post" action="./read_n_print.jsp">
    <input type="text" name="special_text" value=""> <input type="submit" value="Go" > <br>
    <font size="8">Value entered is <%= value %></font>
    </form>
    </body>
    </html>

    Hi DrClap,
    Thanks for your reply.
    That article was helpful in understanding character conversions. And it works fine for JSPs.
    But when I tried to apply the same in JSF it does not work. May be this is not the right forum to dicuss JSF related things. But if you know how pageEncoding and contentType can be mentioned in JSF. I am using myfaces and I have tried <h:form id="SearchForm" acceptCharset="UTF-8" accept="text/html;charset=UTF-8">. Didnt work....

  • Problems with transforming special characters

    Hi,
    I develop a small educational application ( http://sourceforge.net/projects/pauker/ ). I work with JDK-1.4.0 on Mandrake Linux 8.2. At first I used serialized objects to save the lessons to a file. This worked well until I wanted to change some public members of the involved classes. That's why I switched over to the new and shiny XML. Now I have a different problem!
    Pauker saves its lessons in gziped XML files. Users from all over the world can create lessons containing very different characters. There are European characters like ������� and asian characters. Loading this lessons on a system with a different encoding works fine. Saving such a lesson on a system with a different encoding can destroy the lesson.
    Example:
    On a german system a user creates a lesson with the letter � on a card side and saves it. A different user working on an english system loads this lesson. The character "�" is displayed correctly. The english user saves the lesson. The character "�" will be replaced by a question mark in the xml file. Next time the english user loads the lesson she will not see "�" but "?" on the display.
    Here is a little example program that does the transformation in exactly the way Pauker does. Please test it out.
    import java.io.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.*;
    public class XMLTest {
    public XMLTest() {
    try {
    // create document
    DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
    Document document = documentBuilder.newDocument();
    // fill document
    Element element = document.createElement("Element");
    document.appendChild(element);
    element.appendChild(document.createTextNode("�������"));
    // transform to XML
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    //transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    DOMSource source = new DOMSource(document);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    StreamResult result = new StreamResult(outputStream);
    transformer.transform(source, result);
    System.out.println("original: �������");
    System.out.println(outputStream.toString());
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println();
    public static void main(String[] args) {
    new XMLTest();
    So what do I have to do to fix this problem? I have a lot of new features waiting in the CVS but this bug is still open and discussed. I dont want to release a new version with such a gaping hole in it...
    Thanks a lot!
    If you prefer to reply peronally, please use Ronny.Standtke at gmx.de

    I don't see how you can say that there's a problem with saving your XML files when the code you post doesn't actually save it to a file. Your transform is being written to a ByteArrayOutputStream, which isn't used except for this statement which I assume is for debugging:System.out.println(outputStream.toString());Of course that is useless for debugging the problem you describe, for two reasons:
    1. the toString() method uses your system's default encoding, which may be ISO-8859-1 but is definitely not UTF-8. You could write toString("UTF-8") but that is a waste of time because:
    2. You use System.out.println() to examine the data, which writes it to a console that also probably does not use UTF-8. I don't know what encoding it does use, but UTF-8 is unlikely.
    So, save your files using the UTF-8 encoding as robadmin suggested. And to test the result, make sure you use a tool that understands the UTF-8 encoding.

  • Problems with using special characters in Interactive Report Search

    Hi!
    I am currently developing an Application on Application Express 3.1.2.00.02 including a page with an Interactive Report, facing the problem that I cannot use special german characters in the Searchbar.
    So if i try to find a name like 'Schröder' the created Filter looks like this 'Schröder' and i won't get any valid search results. By the way the rest of the application supports these special characters like using them in Buttons or any other Page elements.
    Does anyone have a clue how to fix this problem, because it's driving me nuts ;)
    Thanks in advance
    Philipp
    Edited by: philipp_m on 10.06.2009 11:15

    Does noybody have a clue how to solve this problem. I tried to find out where the Problem occures. The Ajax Request looks like this
    f01     contains
    f01     Schröder
    f01     15
    p_flow_id     100
    p_flow_step_id     50
    p_instance     3176950818119673
    p_request     APXWGT
    p_widget_action     QUICK_FILTER
    p_widget_action_mod     ADD
    p_widget_mod     ACTION
    p_widget_name     worksheet
    p_widget_num_return     15
    x01     14175446766823030
    x02     14176526259823035
    So I guess it has to be inside the Javascript file (apex_ns_3_1.js). I hope someone can help me.
    Bye
    Philipp

  • Problems with Turkish special characters

    Hello!
    We are producing Oracle Help with WebWorks Publisher 2003 Professional for FrameMaker. There are some problems with the Turkish version of our online help: The Turkish special characters (for example the dotless i) aren´t displayed correctly in the navigation panes TOC and index. They are replaced by other characters (for example by a "y")
    Has anyone an idea how to solve this problem?
    Thank you very much.
    Kind regards,
    Miriam Rassenhofer

    Miriam,
    What encoding are the TOC and index XML files being generated in? You should use UTF-8 for the minimum of problems. I presume WebWorks has an option for this. Other than that, make sure the top of those XML files has the proper XML declaration with the encoding:
    <?xml version="1.0" encoding="UTF-8"?>You may want to try opening the XML files in an XML-aware text editor to ensure they look right there (JDeveloper is one such editor).
    If all of that is working, post back and we can talk offline about getting a snippet of one of those XML files for us to look at.
    -brian

  • Problem with german special characters in APEX

    Hi,
    we have a problem with all the special characters in german language in our Application.
    APEX version 3.1.0.00.32 is installed on a oracle database 9.2.0.6.0
    The nls_characterset of the database is: American_America.WE8ISO8859P1
    We have modified the wdbsvr.app file on our HTTP-Server like it's shown in the installationguide for APEX and have set the nls_lang parameter to American_America.AL32UTF8.
    If I look at the source code of the html-pages of our application, there are already the following settings in the header of every page:
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
    With this settings all the german special characters like ä ö ü are not shown correctly in the browser.
    What can I do that the pages are shown correctly?
    Thanks for help!

    Hi Petra,
    ok, so my guess was correct. So the solution is to set the charset attribute in the HTML header to "charset=UTF-8". This is actually the way it should be. But I'm wondering why it is not in your case? Are you using a custom template for the page(s) in question where the charset attribute is set to a custom value? The meta tags in the HTML header are usually set by/through the #HEAD# substitution string in the header definition section of the page template, cp. one of the page templates in Shared Components --> Templates. And as far as I know you are not able to change this substitution string, you can only switch the inclusion on/off with the option "Include Standard CSS and JavaScript" in each page definition. (I might be mistaken, though, I'm quite new to APEX...)
    Regards
    Frank

  • Problem with norwegian 'special characters' (æøå) in LaTeX

    Having installed just about every latex-package in the repos I still cant get this to work. This is what I have in my .tex file:
    \documentclass[12pt,norsk,a4paper]{article}
    \usepackage[norsk]{babel}
    \usepackage[latin1]{inputenc}
    \usepackage[T1]{fontenc}
    \begin{document}
    Testing æøå - ÆØÅ
    \end{document}
    Any suggestions?

    What characters are you trying to put into math mode?
    Generally, with regular LaTeX, you can't put special characters in math mode. You need to use the LaTeX symbol commands instead. For example, use \rightarrow and not →. The only exception would be if you were using XeLaTeX rather than regular (pdf)LaTeX, which generally has better Unicode support, especially if you had loaded the unicode-math packge: but that's still considered in beta status, I believe.
    You can also escape to text mode inside math with the \text command from the amsmath package, e.g., $\text{ÆØÅ}$ should work.
    Last edited by frabjous (2010-09-17 04:12:07)

  • Problem with reading special char from file

    Hello Oracle community,
    Got a problem when reading from a file. I am using a croatian keyboard and trying to read special charachters (ČĆŽŠĐ) from a file.
    declare
      l_file utl_file.file_type;
      s varchar2(200);
    begin
      l_file := utl_file.fopen('test_dir', 'test.txt', 'R');
      loop
        utl_file.get_line(l_file, s);
        dbms_output.put_line(s);
      end loop;
    exception
      when no_data_found then
        utl_file.fclose(l_file);
    end;But I keep getting this in dbms_output: ČƎŠĐ. For some reason it keeps skipping 2 chars Š and Ž. If I try to insert or update data the values are show correctly. What could be the cause of such a problem?
    Best regards,
    Igor

    Hi Igor,
    Looks like a NLS_LANGUAGE issue. Check the following threads:
    UTL_FILE and NLS_LANG setting
    Re: Arabic characters not displaying in Forms
    Regards,
    Sujoy

  • Problem in reading special characters

    Hi friends
    I am doing one program which read serial port data (for bar code reader) using java application.
    My program is working well and reading serial data but it is not displaying special characters.When i read through hyperterminal i can see all special characters but when see data throught the output of java program these special characters are missing...
    I don't know i am doing something wrong in stream or ???
    My code is
    [CODE]public void serialEvent(SerialPortEvent event) {
              System.out.println("before serialEvent");
              StringBuffer readBuffer1 = new StringBuffer();
              switch (event.getEventType()) {
              case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                   System.out.println("Data empty:");
                   break;
              case SerialPortEvent.DATA_AVAILABLE:
                      byte[] readBuffer = new byte[100];
                      int r = 0;
                      try {
                           System.out.print("test"); 
                          //t inputStream = serialPort.getInputStream();
                         while((r = inputStream.read(readBuffer)) != -1) {
                            System.out.print(new String(readBuffer, 0, r));
                      } catch (Exception e) {
                         e.printStackTrace(System.out);
    }[/CODE]Please help

    Hi DrClap,
    Thanks for your reply.
    That article was helpful in understanding character conversions. And it works fine for JSPs.
    But when I tried to apply the same in JSF it does not work. May be this is not the right forum to dicuss JSF related things. But if you know how pageEncoding and contentType can be mentioned in JSF. I am using myfaces and I have tried <h:form id="SearchForm" acceptCharset="UTF-8" accept="text/html;charset=UTF-8">. Didnt work....

  • Problems with german special characters on DOC export.

    Hello,
    I have a problem when I export a pdf to doc via the adobe cloud feature. Everything works fine except for the special german characters. And since I want to use this tool to convert my latex pdf to word to use the spellchecker for me the entire system is broken. Do I need to change to a special encoding of my textfiles for this to work? Can you fix this somehow?
    Cheers
    nenTi

    I use Arial as font generated by MiKTex. So I doubt it's a font problem. Also it detects all other characters without a problem, only the german special chars äöüÄÖÜß are a problem for the system.
    Try it yourself:
    "Hier ist mein scheiß überfordertes konvertierungs script und rödel vor sich hin ohne ännähernd befriedigendes Ergebniß."
    You won't have the special chars editable in the doc. It is visible but you can't edit it because it is converted to something strange.

  • Af:inputFile problems with enconding, special characters

    Hi all,
    searched around the web and in these forum, found this topic:
    af:inputFile encoding file name is not known
    As the author I'm getting the same issue with characters like âáàíí and all things like that
    in my language(Brazilian).
    Instantly after I choose a file the name goes with a � in the place of these chars I mentioned before.
    I changed everything to UTF-8 like my template and jspx file:
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    I also changed my web.xml header:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    And everything in Jdeveloper is set to UTF-8 like IDE and compiler preferences.
    Added this lines to weblogic.xml too:
    <charset-params>
    <input-charset>
    <resource-path>/*</resource-path>
    <java-charset-name>UTF-8</java-charset-name>
    </input-charset>
    </charset-params>
    Everything seens to not work :(
    Using Jdeveloper 11.1.1.3 / Windows XP SP3 Portuguese
    Developing with ADF/EJB3/JPA
    Regards,
    Renan.

    Please check that the compiled pages are UTF-8 encoded. Open the project properties, select 'Compiler' and check the 'Character Encoding*' is set to UTF-8. Next select the 'JSP' node under 'Compiler' and check the encoding there.
    Timo

  • Problem while reading special characters in java

    Hi i am faving the follwing xml.
    <ns1:dc_application_bullets>
    <w:p wsp:rsidR="004E4084" wsp:rsidRPr="007024E6" wsp:rsidRDefault="000D5B97" wsp:rsidP="007024E6">
    <w:r>
    <w:rPr>
    <w:rFonts w:ascii="Arial Unicode MS" w:fareast="Arial Unicode MS" w:h-ansi="Arial Unicode MS" w:cs="Arial Unicode MS" w:hint="fareast" />
    <wx:font wx:val="Arial Unicode MS" />
    <w:lang />
    </w:rPr>
    <w:t>������</w:t>
    </w:r>
    </w:p>
    </ns1:dc_application_bullets>
    no i ma trying to parse this XML using java program and jdom parser. when i try to read the special chacters and print then i ma getting ?? on the console.
    how can i print on to the console as the one what they look.
    any help is appreciated.

    please any bosy throw some light on this.You first. Do you think we're mindreaders? Reading and printing code please.

Maybe you are looking for