Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2007

Tip: Looking for answers? Try searching our database.

streamwriter and pound character

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sudhakar - 31 Jan 2007 19:55 GMT
I want to create a text file with a pound (£) character in it, when i use
StreamWriter class with ASCII (System.Text.Encoding.ASCII) or ANSI
(System.Text.Encoding.Default) encoding the £ (pound) character is either
getting displayed as a ? or as some special character.

It works fine if i use Unicode (System.Text.Encoding.Unicode) encoding, but
i would like my file to be in ANSI format rather than in Unicode format.

Is there any way i can write a £ (pound) character with ANSI
(System.Text.Encoding.Default) encoding? My regional settings are configured
to UK (English).

Any help on this would be greatly appreciated.
Kevin Spencer - 31 Jan 2007 20:59 GMT
The '£' character is not a part of the ASCII character set. It is part of
the Windows Default ANSI Code Page (1252 - Western European Latin), and is
character A3 (163). As for why it is "displayed" as some other character,
that depends on how you're "displaying" it.

I'm awfully curious as to why you don't want to use Unicode.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

The shortest distance between 2 points is a curve.

>I want to create a text file with a pound (£) character in it, when i use
> StreamWriter class with ASCII (System.Text.Encoding.ASCII) or ANSI
[quoted text clipped - 11 lines]
>
> Any help on this would be greatly appreciated.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.