The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Encoding for export

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paschal

Posts: 1621
Nickname: bigapple
Registered: Nov, 2003

Paschal is a .Net developer
Encoding for export Posted: Sep 22, 2004 11:51 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Paschal.
Original Post: Encoding for export
Feed Title: help.net
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/pleloup/Rss.aspx
Feed Description: .Net for mankind !
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Paschal
Latest Posts From help.net

Advertisement

Maybe this trick can help some developers who want to export a Dataset to Excel or Word. Well easy if you're in US without accent issue, but here in Ireland we have some nice accentuation in Irish.

So if you export by default a text containing 'Meánscoil Na mBráithre' using StreamWriter, you have a great chance to obtain this : 'Meánscoil Na mBráithre'

Wrong isn't it :-) So the right solution is to create your Streamwriter object including the correct Encoding (in VB.Net):

Dim objStreamWriter As StreamWriter = New StreamWriter(Server.MapPath(RelativePath+Nameofyourfile.xls), False, Encoding.Default)

The weird thing here is that Encoding.Default is not the same as doing nothing

 

Read: Encoding for export

Topic: I need to slap a toshiba engineer Previous Topic   Next Topic Topic: Playoff Fantasy Baseball

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use