How to change encoding to iso-8859-x in webconfig?

Last post 04-10-2006 1:53 PM by WpgBri. 12 replies.

Sort Posts:

  • How to change encoding to iso-8859-x in webconfig?

    09-03-2005, 12:33 AM
    • Member
      270 point Member
    • laszlo_m
    • Member since 01-28-2005, 11:00 PM
    • Posts 54
    Hi Everybody,

    I was reading the post below about changing encoding in webconfig to get Eastern-European characters.

    http://forums.asp.net/723107/ShowPost.aspx


    I'd like to do it because my registration email is coming back with some untranslated ASCII characters. Email is fine in Outlook but not in Yahoo and Hotmail. Can somebody tell me what to change in the file and what to leave in there?

    Here is the section related to globalization in webconfig:

    <!--  GLOBALIZATION
      This section sets the globalization settings of the application.
      Utf-8 is not supported on Netscape 4.x
      If you need netscape compatiblity leave iso-8859-1.
      UTF-8 is recommended for complex languages
      -->
      <globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8"
       fileEncoding="UTF-8" />
      <!--<globalization culture="en-US" uiCulture="en"  fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"/>-->


    Thanks for the help.

    Laszlo
  • Re: How to change encoding to iso-8859-x in webconfig?

    09-08-2005, 3:58 AM
    • Member
      270 point Member
    • laszlo_m
    • Member since 01-28-2005, 11:00 PM
    • Posts 54

    One of my friend helped me to look into this problem and this is what he found on this issue:

    Problem with Dotnetnuke where the emails that were being sent from registrations (emails that are in different languages other then English) were not readable in their email clients like hotmail or yahoo. 

    I believe the problem lies in that hotmail and yahoo mail do not understand the utf-8 encoded emails but Dotnetnuke forces the utf-8 encoding.  I tried to debug into this and found the following which seems like maybe a bug in DNN: 

    When someone registers the email send gets initiated from this file:
           admin\users\manageusers.ascx.vb

    Ultimately in the stack the SendNotificaiton function bellow will be called:

    public static string SendNotification(string MailFrom, string MailTo, string Bcc, string Subject, string Body, string Attachment, string BodyType, string SMTPServer, string SMTPAuthentication, string SMTPUsername, string SMTPPassword)
    {

          MailFormat format1;

          if ((StringType.StrCmp(SMTPServer, "", false) == 0) && (StringType.StrCmp(Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPServer"])), "", false) != 0))

          {

                SMTPServer = Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPServer"]));

          }

          if ((StringType.StrCmp(SMTPAuthentication, "", false) == 0) && (StringType.StrCmp(Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPAuthentication"])), "", false) != 0))

          {

                SMTPAuthentication = Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPAuthentication"]));

          }

          if ((StringType.StrCmp(SMTPUsername, "", false) == 0) && (StringType.StrCmp(Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPUsername"])), "", false) != 0))

          {

                SMTPUsername = Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPUsername"]));

          }

          if ((StringType.StrCmp(SMTPPassword, "", false) == 0) && (StringType.StrCmp(Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPPassword"])), "", false) != 0))

          {

                SMTPPassword = Convert.ToString(RuntimeHelpers.GetObjectValue(Globals.HostSettings["SMTPPassword"]));

          }

          if (StringType.StrCmp(BodyType, "", false) != 0)

          {

                string text2 = Strings.LCase(BodyType);

                if (StringType.StrCmp(text2, "html", false) == 0)

                {

                      format1 = MailFormat.Html;

                }

                else if (StringType.StrCmp(text2, "text", false) == 0)

                {

                      format1 = MailFormat.Text;

                }

          }

          return Globals.SendMail(MailFrom, MailTo, "", Bcc, MailPriority.Normal, Subject, format1, Encoding.UTF8, Body, Attachment, SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword);

    }

    Now notice that Encoding.UTF8 is being used to send the mail message.

    I would have expected that some config section in the DNN config file (web.config) would have some control over the encoding of the response email for example these flags?

        <globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />

        <!--<globalization culture="en-US" uiCulture="en"  fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"/>-->

    Should the DNN administrator have control over what format the email gets sent in?

    Thanks,

    Laszlo

  • Re: How to change encoding to iso-8859-x in webconfig?

    09-08-2005, 10:41 PM
    • All-Star
      16,504 point All-Star
    • hooligannes97
    • Member since 09-26-2003, 2:57 PM
    • Bolivia
    • Posts 2,917
    • Moderator
    Simply comment the UTF entry and uncomment the iso entry. DNN will restart applying the new settings.
    Do you know the truth when you hear it?
  • Re: How to change encoding to iso-8859-x in webconfig?

    09-09-2005, 12:47 AM
    • Member
      270 point Member
    • laszlo_m
    • Member since 01-28-2005, 11:00 PM
    • Posts 54

    We tried this but this will change the special charaters on the page, which are okay at the moment.  The issue is with the email.

     

    Thanks anyway,

    Laszlo

  • Sv: Re: How to change encoding to iso-8859-x in webconfig?

    09-17-2005, 2:04 PM
    • Contributor
      4,430 point Contributor
    • jan_olsmar
    • Member since 02-06-2004, 12:10 PM
    • Sweden
    • Posts 886
    This could bee a solution for the problem.
    In the  BulkEmail.ascx.vb change the 3 lines with UTF8 to default.

    SendNotification(Administrator, objRecipient.Text, "", "", Priority, Subject, BodyFormat, System.Text.Encoding.Default, strBody, Attachment, SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword)

    line 291,304,311 This will fix the "hotmail2 problem in bulk mails.

    To fix the feedback module you have to change the globals.vb line 609

    Return SendMail(MailFrom, MailTo, "", Bcc, MailPriority.Normal, Subject, objBodyFormat, System.Text.Encoding.Default, Body, Attachment, SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword)

    I havent done any full test of this but at least all mails get the right encoding in my installations. (all servers same language)

    Maybee a confirmation from the core would bee nice, if its a bug or just a next step in the never ending localization project I dont know.
    Anyhow its nice to send out mails that the reader can read.


    Jan O
    www.olsmar.com
  • Sv: Re: How to change encoding to iso-8859-x in webconfig?

    09-17-2005, 2:36 PM
    • Contributor
      4,430 point Contributor
    • jan_olsmar
    • Member since 02-06-2004, 12:10 PM
    • Sweden
    • Posts 886
    The fix for the feedback module will fix the registration problem too.
    Jan O
    www.olsmar.com
  • Re: Sv: Re: How to change encoding to iso-8859-x in webconfig?

    09-18-2005, 1:03 AM
    • Member
      270 point Member
    • laszlo_m
    • Member since 01-28-2005, 11:00 PM
    • Posts 54

    Hi Jan,

    Thanks for the help.  I'll try to do it in the next couple of days and let you know the result.

    Laszlo

  • Geeked [8-|] Sv: Re: How to change encoding to iso-8859-x in webconfig?

    09-18-2005, 5:35 AM
    • Member
      326 point Member
    • WestHam
    • Member since 08-20-2003, 11:08 AM
    • Sweden
    • Posts 65


    I can verify this, I have made thesis changes and now it work as expected.

  • Sv: Re: How to change encoding to iso-8859-x in webconfig?

    01-07-2006, 3:01 PM
    • Member
      326 point Member
    • WestHam
    • Member since 08-20-2003, 11:08 AM
    • Sweden
    • Posts 65
    jan_olsmar wrote:
    This could bee a solution for the problem.
    In the  BulkEmail.ascx.vb change the 3 lines with UTF8 to default.

    SendNotification(Administrator, objRecipient.Text, "", "", Priority, Subject, BodyFormat, System.Text.Encoding.Default, strBody, Attachment, SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword)

    line 291,304,311 This will fix the "hotmail2 problem in bulk mails.

    To fix the feedback module you have to change the globals.vb line 609

    Return SendMail(MailFrom, MailTo, "", Bcc, MailPriority.Normal, Subject, objBodyFormat, System.Text.Encoding.Default, Body, Attachment, SMTPServer, SMTPAuthentication, SMTPUsername, SMTPPassword)

    I havent done any full test of this but at least all mails get the right encoding in my installations. (all servers same language)

    Maybee a confirmation from the core would bee nice, if its a bug or just a next step in the never ending localization project I dont know.
    Anyhow its nice to send out mails that the reader can read.


    It seams that we (DNN-user) have got this old code back again.
    Can I simply replace "UTF8" to "Default" again, in current version 321 & 322?

     

  • Sv: Re: How to change encoding to iso-8859-x in webconfig?

    01-07-2006, 6:44 PM
    • Contributor
      4,430 point Contributor
    • jan_olsmar
    • Member since 02-06-2004, 12:10 PM
    • Sweden
    • Posts 886

    I think this bug was never changed. At least is the bug still in bug tracker without action.

    (in the public area) DNNP-1925

    I havent tested in 3.2.2 and 4.0.2 yet but I asume the same will fix it. The code are now in components/mail folder and the files are mail.vb and sendbulkEmail.vb files.

    So change utf8 to Default.

    Hopfully will some core member read the public bug someday and do the change.

    But I fully understand it is hard for them to have time to read all forums and bug trackers.

    Jan O
    www.olsmar.com
  • Re: Sv: Re: How to change encoding to iso-8859-x in webconfig?

    02-13-2006, 5:53 AM
    • Member
      25 point Member
    • javiero32bcn
    • Member since 06-16-2005, 10:38 PM
    • Posts 5
    Hello i'm working in spanish and i have the problem mentioned above about emails in hotmail an yahoo. If I put some type of "á é í ó ú"  i receive strange characters only in yahoo or hotmail.

    I changed the lines in 3.2.2 for enconding to "Default" and the problem now is: all characters are legible except the "€" symbol. It's appears how "?"

    Do yo know something about this?,   another enconding?




  • Re: How to change encoding to iso-8859-x in webconfig?

    04-07-2006, 5:27 PM
    • Member
      55 point Member
    • WpgBri
    • Member since 11-06-2005, 5:55 PM
    • Posts 11

    I'm a neophite at editing web.config and I'm not sure what I did wrong, but it didn't work for me.

    I took:

    <

    globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8"

    fileEncoding="UTF-8" />

    <!--<globalization culture="en-US" uiCulture="en" fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"/>-->

    <!-- page level options -->

    and changed it to:

    <!

    --<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8"

    fileEncoding="UTF-8" />--

    >

    <globalization culture="en-US" uiCulture="en" fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"/>

    <!-- page level options -->

    <pages validateRequest="false" enableViewStateMac="true" />

    Then I loaded the new web.config to my site. My site still comes up, but none of my Logins work. I tested these carefully; none worked. So I changed it back to the original.

    Did I make the correct changes to web.config above?

  • Re: Sv: Re: How to change encoding to iso-8859-x in webconfig?

    04-10-2006, 1:53 PM
    • Member
      55 point Member
    • WpgBri
    • Member since 11-06-2005, 5:55 PM
    • Posts 11

    I'm using DNN 3.2.2 and the UTF formatting is now in SendBulkEmail.vb

    I can change the entry to Default, but I haven't a clue what to do with the Source package once I've done that. Is there a relativbely straight-forward way to yurn the Source into an Install package?

    Can I use this newly created package to over-write a current installation - without losing all the Users currently in there? Or all the info on the website?

    Regasrds

    Brian

Page 1 of 1 (13 items)