Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

æ ø å Æ Ø Å change into .æ ø Ã¥ à  ÃÜ Ã ¿½

Posted on 2008-06-25
2
Medium Priority
?
513 Views
Last Modified: 2008-06-25
I'm trying to create a vcs file on the fly and submit it to the user. This works fine but when opening the file in Outlook then characters like æ ø å Æ Ø Å are change into æ ø Ã¥ à  ÃÜ Ã ¿½ characters.

I'm opening the file with the following url:
name.aspx?Dato=11/02/2009&Subject=æ_ø_å&body=Æ_ø_Å

How do I get the characters to be displayed as they should?
<%@ Page Language="vb" ContentType="text/html" 
    ResponseEncoding="ISO-8859-1" Debug="False" trace="False"%>
<%@ import Namespace="System.IO" %>
 
<script runat="server"> 
Sub Page_Load(Sender As Object, E As EventArgs) 
 
 'PARAMETERS
   Dim beginDate as Date = Request("Dato")
   Dim endDate as Date  = Request("Dato")
   Dim myLocation as String = ""
   Dim mySubject as String = Request("Subject"))
   Dim myDescription as String = Request("body") & "æ ø å Æ Ø Å"
 
 'INITIALIZATION
   Dim mStream As new MemoryStream()
   Dim writer As new StreamWriter(mStream)
   writer.AutoFlush = true 
 'HEADER
   writer.WriteLine("BEGIN:VCALENDAR")
   writer.WriteLine("PRODID:-//Flo Inc.//FloSoft//EN")
   writer.WriteLine("BEGIN:VEVENT") 
 'BODY
   writer.WriteLine("DTSTART:" & _
            beginDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
   writer.WriteLine("DTEND:" & _
           endDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
   writer.WriteLine("LOCATION:" & myLocation)
   writer.WriteLine("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & myDescription)
   writer.WriteLine("SUMMARY:" & mySubject) 
 'FOOTER
   writer.WriteLine("PRIORITY:3")
   writer.WriteLine("END:VEVENT")
   writer.WriteLine("END:VCALENDAR") 
 'MAKE IT DOWNLOADABLE
   Response.Clear() 'clears the current output content from the buffer
   Response.AppendHeader("Content-Disposition", _
            "attachment; filename=Appointment.vcs")
   Response.AppendHeader("Content-Length", mStream.Length.ToString())
   Response.ContentType = "application/download"
   Response.BinaryWrite(mStream.ToArray())
   Response.End() 
End Sub
</script>

Open in new window

0
Comment
Question by:Tblasters
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 21864666
Try this:

        Dim writer As New StreamWriter(mStream, Encoding.Default)
0
 

Author Comment

by:Tblasters
ID: 21864916
Thanks, that works like a charm!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question