Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-21-2007, 11:26 AM
Member
 
Join Date: Jul 2007
Posts: 8
mirage_87 is on a distinguished road
how to write onto a file
hi,
i m trying to write onto a file.Some of my text is in english and some in urdu.The problem that i m facing is i m able to write the english part correctly but not the urdu part.Here's my code..........



//urdu_synset contains the urdu string
//string1,string2,etc are english strings

fw=new FileWriter("news.txt",true);
fw.write(" \n" + "\n" + "ID :: " + string1 + "\n");
fw.write("CAT :: " + string2 + "\n");
fw.write("CONCEPT :: " + string3 + "\n");
fw.write("EXAMPLE :: " + string4 + "\n");
fw.write("SYNSET-URDU :: ");
fw.close();
fos=new FileOutputStream("news.txt",true);
osw=new OutputStreamWriter(fos,"Unicode");
osw.write(urdu_synset);
osw.flush();


i tried writin the urdu string into a different file using OutputStreamWriter in "unicode" format and it worked fine.....but it 's not workin out here....the string comes out to be garbled...........................

please suggest any suitable solution to my problem.....
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i write to a text file from an arraylist? otoro_java New To Java 3 01-30-2008 07:53 AM
File Write Error vikain Advanced Java 5 01-02-2008 05:38 AM
Write unicode into file vata2999 New To Java 1 08-08-2007 04:04 PM
Help with write file in java mathias New To Java 1 07-31-2007 07:51 PM
how to write the output of the console to a file fred New To Java 1 07-24-2007 03:02 AM


All times are GMT +3. The time now is 04:50 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org