none
Problem in reading unicode text file? RRS feed

  • Question

  • Hi,

    In this case attachmentUrl is "http://moss-2010/Lists/EMPLIST/Attachments/13/हिन्दी.txt

    InputStream is =null;  

    try {

    attachmentURL = attachmentURL.replaceAll(" ", "%20");

    URL u=newURL(attachmentURL); 

    is = u.openStream();

    }

    Here at line is = u.openStream(); it is throwing an exception SharePointException: getListItems (Exception): null

    Other test files in the same URL "http://moss-2010/Lists/EMPLIST/Attachments/13/ora.txt" are opening properly except this unicode text file

    File contents are:(हिन्दी.txt)

    हिन्दी,Hindi
    తెలుగు ,Tamil
    मराठी,Marathi
    પસંદગી,Gujarati
    পছন্দসমূহ,Bengali
    העדפות,Hibrew
    മു൯ഗണനകള്‍, Malyalm

     Please help!!!!

    Monday, October 17, 2011 5:53 AM

All replies

  • In case of C#.net code:

                      string line;

                     StreamReader sr = new StreamReader("हिन्दी.txt", Encoding.UTF8);

     

                     line = sr.ReadLine();

     

                     while (line != null)

                     {

                         Console.WriteLine(line);

                         line = sr.ReadLine();

                     }

     

                     sr.Close();

                     Console.ReadLine();

     

     
     

    It is giving following output. i.e. showing ? instead unicode characters

     

     

      Can anybody help??

      

     
    Monday, October 17, 2011 6:29 AM
  • You should need to install the hindi fonts in your system to display the proper value.
    Regards, Dharnendra Shah "strong belief is the only way to success"
    Monday, October 17, 2011 6:38 AM
  • Hi Dharnendra,

    Hindi fonts are already being installed on my system. but it still not working.Is there any console settings?

    It is for .net can u please tell the solution me for Java , as mentioned above.

    It is restricting to read file at line.

    java.io.BufferedReader br =

    new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(fileName),"UTF-16"));

    What should I do here?


    Monday, October 17, 2011 6:46 AM