Lecture overview -- Keyboard shortcut: 'u'  Previous page: The class Encoding -- Keyboard shortcut: 'p'  Next page: The class TextWriter -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 11 : 40
Object-oriented Programming in C#
Input and Output Classes
Sample use of class Encoding

/user/normark/oop-csharp-1/sources/c-sharp/io/encoding/prog.csSample encodings, conversions, and decodings of a string of Danish characters. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/io/encoding/outputOutput from the Encoding program.


  • Conversions in the example

    • From a unicode string to a byte array in a given encoding    
      (GetBytes - Encoding).

    • From a byte array in one encoding to a byte array in another encoding    
      (Convert)

    • From a byte array in a given encoding to a char array (in unicode)
      (GetChars - Decoding).

    • From a char array (in unicode) to a unicode string encoding.    
      (via String constructor)

Go to exerciseFinding the encoding of a given text file