Autor Beitrag
kostonstyle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 94



BeitragVerfasst: Mo 01.02.10 14:07 
Hallo miteinander
habe eine Frage zu StreamWriter, und zwar geht es um die Buchstabe ä, welche Encoding muss ich mitgeben, damit ä angezeigt wird?
ausblenden C#-Quelltext
1:
StreamWriter file = new StreamWriter(filename, false, Encoding.UTF32);					

danke kostonstyle
danielf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1012
Erhaltene Danke: 24

Windows XP
C#, Visual Studio
BeitragVerfasst: Mo 01.02.10 14:35 
Verschiedene Encodings können Umlaute :) zum Beispiel: Unicode.
danielf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1012
Erhaltene Danke: 24

Windows XP
C#, Visual Studio
BeitragVerfasst: Mo 01.02.10 14:52 
Da habe ich wohl ein bisschen vorschnell geantwortet.

Du verwendest UTF32, was eine Kodierung von Unicode ist und auch Umlaute abspeichern kann.

Ich habe deinen Code deshalb getestet und bei mir funktioniert es einwandfrei.

Ich weiß nicht wo dein Problem ist. Wie zeigst du den die erzeugte Ausgabe an?

Gruß Daniel
kostonstyle Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 94



BeitragVerfasst: Mo 01.02.10 15:31 
vorher
ausblenden C#-Quelltext
1:
2:
   <data>N&#65533;hrwerte / valeurs
nutritives / valori nutritivi</data>


nachher
ausblenden C#-Quelltext
1:
2:
<data>Nährwerte / valeurs
nutritives / valori nutritivi</data>


habe mit
ausblenden C#-Quelltext
1:
StreamWriter file = new StreamWriter(filename, false, Encoding.UTF8);					

versucht, aber leider nicht das richtige Ergebnis.

Was mache ich falsch?
danielf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1012
Erhaltene Danke: 24

Windows XP
C#, Visual Studio
BeitragVerfasst: Mo 01.02.10 15:36 
Du benutzt einen sche... schlechten Viewer der kein UTF8 kann.