Results 1 to 4 of 4

Thread: How to save text file (.txt) in Unicode

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    How to save text file (.txt) in Unicode

    Hi,

    How to save text file (.txt) in Unicode

    please send me small example

    thanking you in advance

    Have a nice day

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmm have you tried the IO.StreamWriter class? doesnt that work with Unicode????

    Just try something like this and see if it works:

    ' make sure you import System.IO first
    Dim sw as streamwriter = file.createText(filePath)


    if not, try this, I've never done it though, I just wrote the code, I guess it will work hehe:

    VB Code:
    1. Dim fs As New FileStream("C:\asd.txt", FileMode.CreateNew)
    2.         Dim sw As New StreamWriter(fs, System.Text.Encoding.Unicode)
    3.  
    4.         'sw.WriteLine
    5.         fs.Close()
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    How to save text file (.txt) in Unicode

    Hi,

    The first one work Ok

    thank you

    Have a nice day

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: How to save text file (.txt) in Unicode

    Originally posted by yulyos
    Hi,

    The first one work Ok

    thank you

    Have a nice day
    aha cool make sure you close the stream though: sw.close( )when you are done

    you're welcome and have a nice day
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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