Pound symbol in a string

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Paul Hadfield (paul_at_anon.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 11:55:27 -0000

All,

When I use system.IO.StreamWriter to write append a string to file that
contains the GBP pound symbol, I notice that it also appends an extra
character before the pond symbol. Yet when I examine the string character by
character in the command window, the extra character is not there.

For example:

Dim Line As New StringBuilder
Line.Append("Cost=£10")

Dim SW As StreamWriter
SW = File.AppendText("C:\Test.txt")

SW.WriteLine(Line(0))

SW.Close()

If I then view the contents of the file in notepad it shows:
Cost=£10

If I use a hex editor to view the contents of the file it shows:
43 6F 73 74 3D C2 A3 31 30 0D 0A

Obviously the 0D and 0A at the end are the Cr+Lf charactors, but I don't
understand where the C2 charactor has come from??

Sorry if this is a silly question - I'm really only used to VB6 - still
trying to get my head around dot net.

Cheers,

Paul.



Relevant Pages

  • [TOMOYO #15 3/8] Common functions for TOMOYO Linux.
    ... This file contains common functions (e.g. policy I/O, pattern matching). ... Since TOMOYO Linux is a name based access control, ... TOMOYO Linux's string manipulation functions make reviewers feel crazy, ... the Linux kernel accepts all characters but NUL character ...
    (Linux-Kernel)
  • RfD: Escaped Strings version 4
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ...
    (comp.lang.forth)
  • RfD: Escaped Strings version 4
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ...
    (comp.lang.forth)
  • Re: file delete routine is intermittent
    ... >> terminator character to every string. ... > Only when you pass a string as a parameter. ... VB does NOT automatically append a null ...
    (microsoft.public.vb.winapi)
  • Re: RfD: Escaped Strings
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... \b BS (backspace, ASCII 8) ... \ ** escapes to characters much as C does. ...
    (comp.lang.forth)