Link to home
Start Free TrialLog in
Avatar of komputer
komputer

asked on

reading text file problem

hi,

i need to read text files and store into database. i can read but i have problem with this turkish characters; ŞşİıĞğ. So i cant store properly. what should i do?

thanks...
Avatar of Mick Barry
Mick Barry
Flag of Australia image

use utf8 encoding to store it
You need to use UTF8 in the db
generally you can specify the encoding oin your connection string
Avatar of komputer
komputer

ASKER

my code to read txt file below;

          try {
            BufferedReader in = new BufferedReader(new FileReader(fileName));
            String data = "";
            while ((str =in.readLine()) != null) {
               
                    data += str;
                  }
            }
            in.close();
        } catch (IOException e) {
              
        }

where should i change?
sorry i am new at java.



ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
  >>you'll also need to specify ewncoding when saving to database

could you send me the needed connection string please?

depends on your database
for oracle?
don't think you need anything special for oracle :)
thanks guys...
:-)
justice for all ;)