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

Similar Messages

  • 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.

  • Problems with reading information sent from a servlet to an applet

    Ihave just created an applet and servlet. i want the servlet to send some data back to the applet so i can read it and just check to see whether the servlet has done the required job.
    here is part of the applet and servlet code.
    applet:
    url = "http://localhost:8080/servlet/Option1Servlet?Firstname="+firstname.getText()
                   +"&Lastname="+lastname.getText()+"&Staffstudentid="+staffstudentid.getText()
                   +"&Position="+position.getText()+"&Email="+email.getText();
              Vector servletInfo = new Vector();
              ObjectInputStream inputFromServlet;
              try{
                   String inputLine;
                   System.out.println(url);
                   URL urlocation = new URL(url);
                   URLConnection uc = urlocation.openConnection();
                   BufferedReader in = new BufferedReader(new InputStreamReader (uc.getInputStream()));
                        while((inputLine=in.readLine()) != null) {
                             servletInfo.add(inputLine);
                   System.out.println("recieved info from servlet about ot process!");
                   inputFromServlet = new ObjectInputStream(uc.getInputStream(checking));
                   checking = (int)inputFromServlet.readInt();
                   System.out.println(checking);
                   in.close();
              catch(java.io.IOException ex) {ex.printStackTrace();}
              if (checking == 0) {
              Regcomplete f5 = new Regcomplete();
              f5.setSize(500,400);
                   this.setVisible(false);
              f5.setVisible(true);
              else if (checking == 1) {
                   firstname.setText("ERROR HAS OCCURED! CLICK CANCEL");
                   lastname.setText("");
                   staffstudentid.setText("");
                   position.setText("");
                   email.setText("");
    servlet:
    public void sendCheckingValue(HttpServletResponse res, int checking) {
              ObjectOutputStream outputToApplet;
              try {
                   outputToApplet = new ObjectOutputStream(res.getOutputStream());
                   System.out.println("Sending int to applet ... ");
                   outputToApplet.writeInt(checking);
                   outputToApplet.flush();
                   outputToApplet.close();
                   System.out.println("Data transmission complete.");
                   System.out.println("Checking value sent = " + checking);
              catch (IOException e) { e.printStackTrace(); }
    i get this exception when i run the code: this exception is thrown in the applet when it attempts to read the input data that has been sent:
    C:\My Documents\logina>appletviewer Login.html
    http://localhost:8080/servlet/Option1Servlet?Firstname=nnnnnnnnn&Lastname=nn&Sta
    ffstudentid=99&Position=mm&Email=mm
    recieved info from servlet about ot process!
    java.io.StreamCorruptedException: Caught EOFException while reading the stream h
    eader
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:845
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:168)
    at Option1.actionPerformed(Option1.java:252)
    at java.awt.Button.processActionEvent(Button.java:329)
    at java.awt.Button.processEvent(Button.java:302)
    at java.awt.Component.dispatchEventImpl(Component.java:2593)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    can anyone help me please its urgent
    thansk
    fahad

    can some one help me plz, its urgent, i get the error at this point in my code what am i doing wrong here.
    inputFromServlet = new ObjectInputStream(uc.getInputStream());

  • How to read appended objects from file with ObjectInputStream?

    Hi to everyone. I'm new to Java so my question may look really stupid to most of you but I couldn't fined a solution by myself... I wanted to make an application, something like address book that is storing information about different people. So I decided to make a class that will hold the information for each person (for example: nickname, name, e-mail, web address and so on), then using the ObjectOutputStream the information will be save to a file. If I want to add a new record for a new person I'll simply append it to the already existing file. So far so good but soon I discovered that I can not read the appended objects using ObjectInputStream.
    What I mean is that if I create new file and then in one session save several objects to it using ObjectOutputStream they all will be read with no problem by ObjectInputStream. But after that if in a new session I append new objects they won't be read. The ObjectInputStream will read the objects from the first session after that IOException will be generated and the reading will stop just before the appended objects from the second session.
    The following is just a simple test it's not actual code from the program I was talking about. Instead of objects containing different kind of information I'm using only strings here. To use the program use as arguments in the console "w" to create new file followed by the file name and the strings you want save to the file (as objects). Example: "+w TestFile.obj Thats Just A Test+". Then to read it use "r" (for reading), followed by the file name. Example "+r TestFile.obj+". As a result you'll see that all the strings that are saved in the file can be successfully read back. Then do the same: "+w TestFile.obj Thats Second Test+" and then read again "+r TestFile.obj+". What will happen is that the strings only from the first sessions will be read and the ones from the second session will not.
    I am sorry for making this that long but I couldn't explain it more simple. If someone can give me a solution I'll be happy to hear it! ^.^ I'll also be glad if someone propose different approach of the problem! Here is the code:
    import java.io.*;
    class Fio
         public static void main(String[] args)
              try
                   if (args[0].equals("w"))
                        FileOutputStream fos = new FileOutputStream(args[1], true);
                        ObjectOutputStream oos = new ObjectOutputStream(fos);
                        for (int i = 2; i < args.length ; i++)
                             oos.writeObject(args);
                        fos.close();
                   else if (args[0].equals("r"))
                        FileInputStream fis = new FileInputStream(args[1]);
                        ObjectInputStream ois = new ObjectInputStream(fis);
                        for (int i = 0; i < fis.available(); i++)
                             System.out.println((String)ois.readObject());
                        fis.close();
                   else
                        System.out.println("Wrong args!");
              catch (IndexOutOfBoundsException exc)
                   System.out.println("You must use \"w\" or \"r\" followed by the file name as args!");
              catch (IOException exc)
                   System.out.println("I/O exception appeard!");
              catch (ClassNotFoundException exc)
                   System.out.println("Can not find the needed class");

    How to read appended objects from file with ObjectInputStream? The short answer is you can't.
    The long answer is you can if you put some work into it. The general outline would be to create a file with a format that will allow the storage of multiple streams within it. If you use a RandomAccessFile, you can create a header containing the length. If you use streams, you'll have to use a block protocol. The reason for this is that I don't think ObjectInputStream is guaranteed to read the same number of bytes ObjectOutputStream writes to it (e.g., it could skip ending padding or such).
    Next, you'll need to create an object that can return more InputStream objects, one per stream written to the file.
    Not trivial, but that's how you'd do it.

  • Problem with reading config file

    Hello,
    I have problem with reading config file from the same dir as class is. Situation is:
    I have servlet which working with DB, and in confing file (config.pirms) are all info about connection (drivers, users, passw, etc.). Everything work fine if I hardcoded like:
    configFileName = "C:\\config.pirms";I need to avoid such hardcoding, I tryied to use:
    configFileName = Pirms.class.getClassLoader().getResourceAsStream ("/prj/config.pirms").toString();but it isn't work.
    My config file is in the same directory as Pirms.class (C:\apache-tomcat-5.5.17\webapps\ROOT\WEB-INF\classes\prj)
    Also I tryied BundledResources, it isn't work fo me also.
    Can anybody help me to solve this problem? with any examples or other stuff?
    Thanks in advance.
    Andrew

    Thanks, but I am getting error that "non-static method getServletConfig() cannot be referenced from a static context"
    Maybe is it possibility to use <init-param> into web.xml file like:
    <init-param>
      <param-name>configFile</param-name>
      <param-value>/prj/config.pirms</param-value>
    </init-param>If yes can anybody explain how to do that?
    I need to have that file for:
    FileReader readFile = new FileReader(configFile);Thanks in advance.

  • Problem on reading and writing from from a *.txt file

    I get Problem on reading and writing from from a *.txt file. The following is the read() method...
    The software said the DataInputStream is depreciated. Can anyone help me please?
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        String str = "";
        try
          in = new BufferedReader(file);
          //in = new FileInputStream(file);
          for(;;)
            str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);
      }

    Thank you for your reply. I have made some change. However, there is an incompetable type found error.
    in = new BufferedReader(new InputStreamReader(in));The following are all of the code.
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        //BufferedReader in = null;
        String str = "";
        try
          in = new BufferedReader(new InputStreamReader(in));
          //in = new FileInputStream(file);
          for(;;)
            BufferedReader Bstr = new BufferedReader(new InputStreamReader(in));
            //str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • I am facing a Problem with reading images from database

    Hi everybody..
    any help will be most appreciated, I am facing problem with reading images from database. I am pasting my code... 
                    string connect = "datasource = localhost; port = 3306; username = root; password = ;"; 
                    MySqlConnection conn = new MySqlConnection(connect); // creating connecting string
                    MySqlCommand sda = new MySqlCommand(@"select * from management.add_products ", conn); //creating query
                    MySqlDataReader reader; 
                    try
                        conn.Open(); // Opening Connection
                        reader = sda.ExecuteReader(); // Executing my Query..
                        while (reader.Read())
                            byte[] imgg = (byte[])(reader["Picture"]);
                            if (imgg == null)
                                pc1.Image = null;
                            else
                                MemoryStream mstream = new MemoryStream(imgg);
                                pc1.Image = System.Drawing.Image.FromStream(mstream);
    It says Parameter not Valid... i am reading all the images from database

    I agree with Viorel. You are getting the error because the format of the data is incorrect probably because the data was modify. It may not be the reading of the database the is incorrect, but the application that wrote the data into the database. You need
    to compare the imgg array data with the data before it was written to the database to see if the data matches.  I usually start by comparing the number of bytes which is easier to check then compare the actual to isolate which function is changing the
    byte count.
    An image is binary data.  The standard VS methods for reading and writing data (usually stream classes) default to ASCII encoding which will corrupt binary data.  The solution usually is to use UTF8 encoding instead of the default ascii encoding. 
    Ascii encoding with stream often aligns the data and adds extra null bytes to the end of the data which can produce these type errors.
    jdweng

  • I just started using my iphone 5s. I have a problem with new incoming emails from my POP account. Why are they marked as read automatically even though I have not even opened them yet.

    I just started using my iphone 5s. I have a problem with new incoming emails from my POP account. Why are they marked as read automatically even though I have not even opened them yet.
    At first I thought it might be because I was using simultaneously my old iPhone 4S so it somehow realized the emails where being pushed to another device and the it marked as read, this has nothing to do since I have deleted the email account from the iPhone 4S

    Contact the email provider for assistance with their service.

  • Need help with EXS24 "read velocity range from file name"

    I am trying to import 127 drum samples to a single key using the option shown here. The option says "Map to key dropped on and read velocity range from file name". I can find no documentation in the manuals on how to do this. What is the syntax required in the file name to make this work? I need to do several of these imports. The capability is cleary there, but I need help on how the file name should be formatted. My thanks to anyone who can help.

    Hi
    Not a direct answer to your question, but if you are doing a lot of sample mapping etc, you may want to check out Redmatica's KeyMap Pro or the simpler Keymap 1:
    http://www.redmatica.com
    CCT

  • Problems with importing text messages from PC Suit...

    Problems with importing text messages from PC Suit 7.1.18.0 to my Nokia 5800
     I am trying to import a csv file that contains text messages (Note that this file was created using PC Suit 7.1.18.0) to a subfolder that I have created to My Folders but PC Suits only imports the text messages to the Draft folder. Note that initially it shows that the messages are import in the correct folder but after a refresh it shows them in the Draft Folder. Is their any setting that I should change in the PC Suit or the phone? My computer runs on Windows XP Service Pack 3 and the Nokia 5800 was upgraded to the latest firmware v20.0.012
     Thanks for your help

    Most phones only allows importing of draft and archived box for SMS.
    To do a restoring, you need to backup the SMS as a .nbu file using PC Suite and restore later.
    If you got an SD card, you can also do a backup on the SD Card (backup.arc) then restore later (reset and restore: backup.arc and mmc).
    What's the law of the jungle?

  • Problem with pdf display downloaded from application server

    Hi all,
    I have a problem with displaying pdf downloaded from application server (saved in BINARY MODE).
    I am getting the pdf output of adobe form in FPFORMOUTPUT-PDF as rawstring back to my program and then converting that rawstring into binary form using the function module SCMS_BINARY_TO_STRING.
    Now, when I export the data to presentation server directly using cl_gui_frontend_services=>gui_download, the pdf is downloaded properly.
    However, when I save the data to application server file by looping at the internal table obtained from SCMS_XSTRING_TO_BINARY and using TRANSFER, and subsequently downloading the file in "unconverted format" from AL11 to my desktop, I am getting a "blank" pdf file (with the same number of pages as the one downloaded using gui_download).
    I have tried different encodings during download but in those cases i get corrupted pdf message. only the default option of INTIAL value seems to work.
    I am forced to believe that there is a problem in my code which saves the data to app server but I cant find any solution that is logical. Any solution to this would be greatly appreciated.
    Regards,
    Sasi
    Edited by: Sasi Upadrasta on Sep 29, 2010 7:55 PM

    used a program to read the file from appl server and then downloading it to desktop.

  • How can I Retrieve special chars from a HTTP Request??

    Hi,
    I want to retrieve special chars from a request
    Chars like accents used in spanish languages or symbols?
    Is there any way to do it
    Thanks in advance
    Alejandro Arredondo

    This is my problem
    For example:
    This is my form:
    <form>
    <input type="text" name="test">
    </form>
    I do write a char on the text area. Something like "?" or "?"
    or some words with accents
    When I retrieve the value with
    String value = request.getParameter("test");
    and print it
    out.println("TEST= " + test);
    It prints another symbol that isn't the one I sent in my form.
    why?
    Thanks

  • I can't read a Object from file, Please help me

    i want to write a Object into File. this is code of Object
    class objStoreCus implements Comparable, Serializable
    String customerID = new String();
    String customerName = new String();
    String customerEmail = new String();
    objStoreCus(String cusID, String cusName, String cusEmail)
    customerID = cusID;
    customerName = cusName;
    customerEmail = cusEmail;
    objStoreCus(){}
    public int compareTo(Object o)
    objStoreCus oS = new objStoreCus();
    oS = (objStoreCus)o;
    return(customerEmail.compareTo(oS.customerEmail));
    private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();
    private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    try
    s.defaultReadObject();
    }catch(IOException ie){throw new IOException();}
    catch(ClassNotFoundException cnt){throw new ClassNotFoundException();}
    And I was wrote above Object into File by this code :+
    FileOutputStream fos;
    ObjectOutputStream oos;
    FileInputStream fis;
    ObjectInputStream ois;
    public void writeObjToFile(objStoreCus obj)
    try
    fos = new FileOutputStream("Exrcise3.ex3", true);
    }catch(FileNotFoundException fnfe){}
    try
    oos = new ObjectOutputStream(fos);
    //ghi doi tuong vao file
    oos.writeObject(obj);
    //dong stream
    oos.close();
    fos.close();
    }catch(IOException ie){}
    But i can't read above Object from file. allway have a Exception occur "StreamCorruptedException".
    this is code read Object form file :
    *parameter is ArrayList will be store Object from file.
    public void readObjFromFile(ArrayList al)
    try
    fis = new FileInputStream("Exrcise3.ex3");
    }catch(FileNotFoundException fnfe){}
    try
    ois = new ObjectInputStream(fis);
    while(true)
    try
    objStoreCus osc = new objStoreCus();
    osc = (objStoreCus)ois.readObject();
    System.out.println(osc.customerEmail);
    }catch(Exception e)
    e.printStackTrace();
    //System.out.println();
    break;
    ois.close();
    fis.close();
    }catch(IOException ie){}
    }

    Problem lies in
    os = new FileOutputStream("Exrcise3.ex3", true);
    You are trying to append to that file, You should always use new file to serialize objects.
    os = new FileOutputStream("Exrcise3.ex3");
    Try with above line.

  • Having problem with reading list in safari

    i am having problem with reading list in safari some time it work sometimes gets hang....

    Might be a cache issue ...
    Open a Finder window. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following:
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari to test.

Maybe you are looking for

  • Windows Sharing "Accounts..." passwords do not reset?

    I am trying to connect my PC to my Mac and it seems to work fine for my laptop but not for my G5 tower. So, I went into my sharing preferences on my G5 and checked that my Windows Sharing was turned on, it was. Then I clicked on the Accounts... butto

  • Is there a way to migrate AD users to different domain?

    Hello SharePoint Fam, I have a 10,000 user environment and these users are spread across 15 different domains.  Our data/network team are beginning to migrate and consolidate our environment down to one domain.  We did a test and had them migrate a c

  • Need an IF condition, if Prod No has multiple same STCTS values

    Hi, I need to write the logic like below : loop at t_final into wa_final. If PRVSY(Product Number) has multiple same STCTS values if wa_final-datab > sydatum. clear wa_final-stcts. delete t_final where stcts is initial. endif. endif. endloop.   For e

  • Need failed and passing scores to be sent to LMS

    I need to track all test attempts and score (passed and failed). Currently, my LMS (SUMTOTAL) will only report on passing scores. I can see that a learner has taken the test 10 times and the passing score, but I can't see their scores on attempts 1-9

  • OOP Design: controllin​g multiple (similar) devices

    Hi guys, We have some software that controls different kinds of "widgets." They are identicle  in function, but they are from differering vendors and have different drivers and APIs. But here's the tricky part: they may be used by themselves, or in a