Results 1 to 4 of 4

Thread: unicode text file

  1. #1

    Thread Starter
    Member schizo's Avatar
    Join Date
    Sep 2003
    Location
    http://blackskull.cjb.net
    Posts
    42

    unicode text file

    i need to create a unicode text file.
    i have lots of unrecognized characters in my database which are swedish and stuff...

    how do i write a text file which can support these types of characters?

    i need to pass that file to rar as a rarlist of files.

    when i created a normal text file, rar cannot understand the other characters, but when i created it in unicode, using ultra edit, rar was able to recognize the characters. so how do i create this file in c#?

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: unicode text file

    Try something like this , I didn't test it but it should give you the idea :
    Code:
    Stream st=File.Open("filename",FileMode.Open);
    Encoding enc=Encoding.GetEncoding("pass your text here or see other params");
    StreamWriter sw=new StreamWriter(st,enc);
    sw.Write("write anything to the file");
    sw.Close();

  3. #3
    New Member
    Join Date
    Jan 2005
    Posts
    7

    Re: unicode text file

    You can use System.IO.StreamWriter class.
    You can use the method Write of StreamWriter and can also specify the Encoding when you write into a file !

    have a nice day

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Quote Originally Posted by loverdose
    You can use System.IO.StreamWriter class.
    You can use the method Write of StreamWriter and can also specify the Encoding when you write into a file !
    have a nice day
    That's in another word !huh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width