Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTF-8 file reading: the first character issue

807580May 18 2010 — edited May 25 2010
Hi,
A file foo.sql is saved as UTF-8 encoding using Windows notepad.

Then the following code did not read the text content correctly.

InputStreamReader isr = new InputStreamReader(new FileInputStream("foo.sql"), "UTF-8");
BufferedReader reader = new BufferedReader(isr);
String line = reader.readLine();

From debug, the first character is not displayable. for example,

foo.sql
----------
create table school

the line from BufferedReader is
?create table school

the question mark means the char is not displayable. What is the correct way to read UTF-8 encoded text file?

Thanks for help.
Dave

Comments

390020
AFAIK you need -at least- the oracle instant client. Which is considerably smaller than the Oracle client, BTW. Hope somebody can probe me wrong.
604934
It is correct that you will need some so libraries for cx_oracle to work. So you need an Oracle database home, client home or at least instant client home to have those libraries.

Regards,
Husnu Sensoy
783174
Hi I am new to this python and Oracle. I am also encountering the same error.
I wish to connect to a database located on another machine using python from my machine. I dont have Oracle installed on my system but it is there on that remote machine.

I am also encountering the same error.

Right now I am using Oracle SQLdeveloper to connect to that database . But I wish to do the same using a python script.

Can you please help me with this error .

I have :-

sqldeveloper-2.1.1.64.45
python :- 2.6.5

Thanks,
Shantanu

Error which I encounter :-
import cx_Oracle

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import cx_Oracle
ImportError: DLL load failed: The specified procedure could not be found.
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 22 2010
Added on May 18 2010
7 comments
4,238 views