[thelist] asp.net: Unicode Encoding Problem

Ken Schaefer Ken at adOpenStatic.com
Wed Jul 13 22:45:07 CDT 2005


The File.CreateText method doesn't not have a signature (Path, Encoding)
AFAIK:
ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemIOFileClassCreateTextT
opic.htm

If you explicitly create a StreamWriter object, then there is a constructor
that has that signature.

Cheers
Ken

--
www.adOpenStatic.com/cs/blogs/ken/ 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Casey
: Sent: Thursday, 14 July 2005 1:20 PM
: To: thelist at lists.evolt.org
: Subject: [thelist] asp.net: Unicode Encoding Problem
: 
: I'm using a simple StreamWriter to over right the contents of a file:
: 
: Sub Page_Load(S as Object, E as EventArgs)
:  dim myStreamWriter as StreamWriter
:  dim onPage as string = Request.QueryString("page")
:  myStreamWriter = File.CreateText(MapPath("../pages/content_includes/" &
: onPage & ".ascx"), System.Text.Encoding.UnicodeEncoding )
:  myStreamWriter.WriteLine(Session("previewText"))
:  myStreamWriter.Close
: End Sub
: 
: I added the ", System.Text.Encoding.UnicodeEncoding " because I was having
: trouble with certain greek charectors being altered when the file was
: re-written.  But I now get this error:
: 
: BC30390: 'System.Text.Encoding.unicodeEncoding' is not accessible in this
: context because it is 'Private'.
: 
: I will confess that all this unicode endcoding is new to me.  What must I
: do to ensure the stability of the content?


More information about the thelist mailing list