PC Review


Reply
 
 
Frank
Guest
Posts: n/a
 
      19th Jul 2004
Hi,
what IO class or encoding writes a + umlaut (ä) as 1 character to a file?
Looks like streamwriters don't, should I use binarywriter?
Thanx in advance
Frank


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5hbmRbTVZQXQ==?=
Guest
Posts: n/a
 
      19th Jul 2004
The umlaut character is a single byte character, but strings in .NET are by default Unicode strings. Maybe try using the ASCII encoder(look at the ASCIIEncoding class) and then writing to the stream.

Rgds,
Anand
VB.NET MVP
http://www.dotnetindia.com

"Frank" wrote:

> Hi,
> what IO class or encoding writes a + umlaut (ä) as 1 character to a file?
> Looks like streamwriters don't, should I use binarywriter?
> Thanx in advance
> Frank
>
>
>

 
Reply With Quote
 
Frank
Guest
Posts: n/a
 
      19th Jul 2004
No, the ascii encoding only takes 7 bits, for a + umlaut you need 8 bits.
Frank
"Anand[MVP]" <(E-Mail Removed)> wrote in message
news:21D4AB41-72CB-473A-91D7-(E-Mail Removed)...
> The umlaut character is a single byte character, but strings in .NET are

by default Unicode strings. Maybe try using the ASCII encoder(look at the
ASCIIEncoding class) and then writing to the stream.
>
> Rgds,
> Anand
> VB.NET MVP
> http://www.dotnetindia.com
>
> "Frank" wrote:
>
> > Hi,
> > what IO class or encoding writes a + umlaut (ä) as 1 character to a

file?
> > Looks like streamwriters don't, should I use binarywriter?
> > Thanx in advance
> > Frank
> >
> >
> >



 
Reply With Quote
 
Mattias Sjögren
Guest
Posts: n/a
 
      19th Jul 2004

>Looks like streamwriters don't, should I use binarywriter?


StreamWriter should work find as long as you initialize it with the
appropriate Encoding.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
Frank
Guest
Posts: n/a
 
      19th Jul 2004
No, it doesn't. a + umlaut is written something like Ã".
Frank

"Mattias Sjögren" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
>
> >Looks like streamwriters don't, should I use binarywriter?

>
> StreamWriter should work find as long as you initialize it with the
> appropriate Encoding.
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.



 
Reply With Quote
 
Mattias Sjögren
Guest
Posts: n/a
 
      19th Jul 2004

>No, it doesn't. a + umlaut is written something like Ã".


So which encoding are you using, and which tool are you then checking
the result with?



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Jul 2004
* "Frank" <(E-Mail Removed)> scripsit:
> No, the ascii encoding only takes 7 bits, for a + umlaut you need 8 bits.
> Frank


Depending on where you live, pass 'Encoding.Default' to the
'StreamWriter's constructor.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
Frank
Guest
Posts: n/a
 
      19th Jul 2004
I tried several encoding settings in streamwriter. None gave me a+umlaut.
Frank

"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> * "Frank" <(E-Mail Removed)> scripsit:
> > No, the ascii encoding only takes 7 bits, for a + umlaut you need 8

bits.
> > Frank

>
> Depending on where you live, pass 'Encoding.Default' to the
> 'StreamWriter's constructor.
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>
> <URL:http://dotnet.mvps.org/dotnet/faqs/>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Jul 2004
* "Frank" <(E-Mail Removed)> scripsit:
> I tried several encoding settings in streamwriter. None gave me a+umlaut.


What application to you use to take a look at the file?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
Frank
Guest
Posts: n/a
 
      19th Jul 2004
does it matter? I checked with a hexeditor.
Frank
"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> * "Frank" <(E-Mail Removed)> scripsit:
> > I tried several encoding settings in streamwriter. None gave me

a+umlaut.
>
> What application to you use to take a look at the file?
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>
> <URL:http://dotnet.mvps.org/dotnet/faqs/>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASCII Help mattc66 via AccessMonster.com Microsoft Access Queries 3 18th Oct 2006 06:32 AM
how to convert non-ISO extended-ASCII to ISO ascii dotNeter Microsoft Dot NET 1 29th Jun 2006 06:53 PM
How can I convert high ASCII to low ASCII Friso Wiskerke Microsoft VB .NET 6 7th Jan 2005 05:52 PM
DOS ASCII Code vs Windows ASCII Code??? Daniel Olivares Microsoft Windows 2000 Developer 0 6th Apr 2004 11:02 PM
Re: ASCII Low Values (Ascii 0) to a string Manfred Suttorp Microsoft Dot NET Framework 2 25th Jul 2003 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:05 AM.