Just nu i M3-nätverket
Jump to content

Hur får man åäö


ABCDEF

Recommended Posts

using System;

using System.IO; // OBS!

namespace ConsoleApplication4

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[sTAThread]

static void Main(string[] args)

{

//

// TODO: Add code to start application here

//

 

string filename = @"C:\mitt.htm";// obs! lägger sig på hårddisken C

 

StreamWriter streamWrite = File.CreateText(filename);

streamWrite.WriteLine("<html>");

streamWrite.WriteLine("<head>");

streamWrite.WriteLine ("<title>Namn här</title>");

streamWrite.WriteLine("<body>");

streamWrite.WriteLine("vill ha åäö ÅÄÖ");

 

streamWrite.Close();

 

}

}

}

 

Link to comment
Share on other sites

Du måste ange rätt encoding. På svenskt inställd Windows kan du t ex göra så här:

StreamWriter wr = new StreamWriter(fileName, false, System.Text.Encoding.Default);

 

/

 

Link to comment
Share on other sites

När du kopierar från här försvinner snabel-a "här"

 

//

// TODO: Add code to start application here

//

 

string filename = "här""C:\mitt.htm";// obs! lägger sig på hårddisken C

 

 

 

sätt in det så fungerar det

 

 

Link to comment
Share on other sites

Tack det fungerar såg också att &Ouml osv. fungerar

 

//StreamWriter streamWrite = File.CreateText(filename);

StreamWriter streamWrite = new StreamWriter(filename, false, System.Text.Encoding.Default);

 

streamWrite.WriteLine("<html>");

streamWrite.WriteLine("<head>");

streamWrite.WriteLine ("<title>Namn här</title>");

streamWrite.WriteLine("<body>");

streamWrite.WriteLine("vill ha åäö ÅÄÖ och &Ouml");

 

streamWrite.Close();

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...