// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; using System.Text; public class N { public static void Main(string[] args) { string s1 = "���æøå"; string s2 = "\u00C6\u00D8\u00C5\u00E6\u00F8\u00E5"; using(StreamWriter sw = new StreamWriter("n1.txt", false, Encoding.GetEncoding("iso-8859-1"))) { sw.WriteLine("{0} = {1}", s1, s2); } using(StreamWriter sw = new StreamWriter("n2.txt", false, Encoding.GetEncoding("utf-8"))) { sw.WriteLine("{0} = {1}", s1, s2); } } }