Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8534703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:15:26+00:00 2026-06-11T10:15:26+00:00

Im new to this, but have got a generation script to ics file, to

  • 0

Im new to this, but have got a generation script to ics file, to working 100% for iCal and Outlook, but i cant see how i fixing the Encoding.

When i have a text in my Database with the nordic æ ø å (æ ø å) then i get the letters as ?.
Can someone help me setting this up to use iso-8859-1.

OR do i need to make 6 replace code that replace the letter with the html-tag (æ ø å) !?

My code is

Imports System.Data.OleDb
Imports System.Data
Imports RF.Event2

Partial Class _new
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then

    End If
End Sub

Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim ical As New iCalendar()

    Dim strConnection As OleDbConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings("ConnStr").ConnectionString)
    Dim strQuery As String = String.Empty

    strQuery = "SELECT * FROM [Events] WHERE ([EventType]='K' OR [EventType]='E' OR [EventType]='T') ORDER BY [EventDate] ASC"
    Dim daEvents As New OleDbDataAdapter(strQuery, strConnection)
    Dim dtEvents As New DataTable
    strConnection.Open()
    daEvents.Fill(dtEvents)
    strConnection.Close()

    If (dtEvents.Rows.Count > 0) Then

        For i As Integer = 0 To dtEvents.Rows.Count - 1
            Dim ev As New [Event]()
            ev.Title = dtEvents.Rows(i)("EventHome")
            ev.Description = dtEvents.Rows(i)("EventNote")
            ev.Location = dtEvents.Rows(i)("EventPlace")
            ev.StartTime = DateTime.Parse(dtEvents.Rows(i)("EventDate"))
            ev.EndTime = DateTime.Parse(dtEvents.Rows(i)("EventDate").AddMinutes(90))
            ical.Events.Add(ev)
        Next
    End If
    ' Set the content-type of the response and file name
    ' so Windows knows how to handle the response.
    Context.Response.Buffer = True
    Context.Response.ContentType = "text/calendar"
    Context.Response.ContentEncoding = Encoding.GetEncoding("iso-8859-1")
    Context.Response.Charset = "iso-8859-1"
    Context.Response.AddHeader("content-disposition", "inline;filename=Sport.ics")

    ' Write the bytes of the iCalendar item output to the resonse stream
    Context.Response.BinaryWrite(New System.Text.ASCIIEncoding().GetBytes(ical.Output))
    Context.Response.[End]()

    'Dim enc As System.Text.Encoding = System.Text.Encoding.GetEncoding("iso-8859-1")
End Sub


End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:15:28+00:00Added an answer on June 11, 2026 at 10:15 am

    You are writing to the stream using ASCIIEncoding which maps the problematic characters to ‘?’.

    You can fix your code and make it resistant to this bug doing a few modifications:

    Context.Response.ContentEncoding = Encoding.GetEncoding("iso-8859-1") 
    Context.Response.Charset = Context.Response.ContentEncoding.WebName
    Context.Response.AddHeader("content-disposition", "inline;filename=Sport.ics") 
    
    ' Write the bytes of the iCalendar item output to the resonse stream 
    Context.Response.BinaryWrite(Context.Response.ContentEncoding.GetBytes(ical.Output)) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database connection that I got like this: db = Mongo::Connection.new.db(app-development) but
I'm very new to C, but have no idea why this program breaks. The
I am new to Emacs. I have googled this but no good answer there.
I am pretty new to this iPhone dev thing but so far I have
I think this is mostly because I'm new to PHP OOP, but I have
I have this: var blockRegEx = new Regex((proc sql;)(.*?)(quit;), RegexOptions.IgnoreCase | RegexOptions.Multiline); but it
This should be pretty simple, but I am new at LINQ. I have a
I have plenty of experience with this in PHP, but am fairly new to
Ok, this may have been answered, but I'm new and trying to learn, so
HI, I have almost solved this but have now got stuck! What I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.