From: Zach on 21 Jun 2010 15:04 I am reading from an ASCII file containing addresses. Those addresses are being combined with a letter to produce a mailing. So there is reading with StreamReader (the address) and writing with StreamWriter (the address + letter assembly). Some of the addresses contain funnies like accents and what the Germans would call Umlauts etc., etc. I have tried Encoding.UTF8 new UTFEncoding() Encoding.ASCII Neither of them do the job of properly dealing with the funnies. Can someone help me out? Many thanks, Zach.
From: Jeff Johnson on 21 Jun 2010 15:50 "Zach" <xx(a)yy.zz> wrote in message news:ux6xhSXELHA.5500(a)TK2MSFTNGP05.phx.gbl... >I am reading from an ASCII file containing addresses. Those addresses are >being combined with a letter to produce a mailing. So there is reading with >StreamReader (the address) and writing with StreamWriter (the address + >letter assembly). > > Some of the addresses contain funnies like accents and what the Germans > would call Umlauts etc., etc. > > I have tried > > Encoding.UTF8 > new UTFEncoding() > Encoding.ASCII > > Neither of them do the job of properly dealing with the funnies. Nope, they wouldn't. Try Encoding.Default first. If that doesn't work then you'll have to determine the code page that the file was created with, and that probably won't be fun.
From: Zach on 21 Jun 2010 18:56 "Jeff Johnson" <i.get(a)enough.spam> wrote in message news:hvofpj$4pf$1(a)news.eternal-september.org... > "Zach" <xx(a)yy.zz> wrote in message <snipped> > Nope, they wouldn't. Try Encoding.Default first. If that doesn't work then > you'll have to determine the code page that the file was created with, and > that probably won't be fun. I had a brain wave, I read the file into Word, and saved it as text, selecting the encoding. It worked. Zach.
From: Harlan Messinger on 22 Jun 2010 00:42 Zach wrote: > I am reading from an ASCII file containing addresses. Those addresses > are being combined with a letter to produce a mailing. So there is > reading with StreamReader (the address) and writing with StreamWriter > (the address + letter assembly). > > Some of the addresses contain funnies like accents and what the Germans > would call Umlauts etc., etc. If the file contains accented characters, then it isn't an ASCII file. You need to find out what the file's encoding *really* is. > > I have tried > > Encoding.UTF8 > new UTFEncoding() > Encoding.ASCII As I said, you need to know what the file's encoding is rather than randomly trying things.
From: Zach on 22 Jun 2010 03:54 "Harlan Messinger" <h.usenetremoverthis(a)gavelcade.com> wrote in message news:88atadFebdU2(a)mid.individual.net... < snipped> > As I said, you need to know what the file's encoding is rather than > randomly trying things. Sorry, you didn't read my previous post? When you load a file to Word, Word does the sorting out bit, subsequently you can select the encoding with which to file the page in Word to a new file. That only takes a minute, and isn't randomly trying things. Zach.
|
Next
|
Last
Pages: 1 2 Prev: Only load actually visible items? Next: Trouble with initialization vector (IV) for AES |