Results 1 to 9 of 9

Thread: [2005] Porbably an encoding problem

  1. #1

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Exclamation [2005] Porbably an encoding problem

    Hi all,
    I don't know if my problem is .NET related, SQL Server related or windows related. But I know it's Microsoft related (not blaming or pointing fingers).

    Here is my problem:
    I have an ASP.NET website running under IIS 6 (Windows 2003) using .NET 2.0 and an SQL Server 2005 DB.
    For some reason sometimes the special characters such as ., @ ... show up as %2E, %40... etc and I can't find out why.

    Any help is really appreciated
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: [2005] Porbably an encoding problem

    Show up where? IN your database, or on your webpage?

  3. #3

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [2005] Porbably an encoding problem

    Quote Originally Posted by nemaroller
    Show up where? IN your database, or on your webpage?
    On web pages, and specifically when auto filling text boxes
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: [2005] Porbably an encoding problem

    Sounds like you're specifically encoding text and assigning it to a server control in a manner that invokes it to html encode its input - resulting in a double-encoded string. Or probably more disturbing, you have html-encoded data in your database. A simply query of the tables will allow you to make sure.

    Try a find search for :
    ".Text = HttpUtility.HtmlEncode"

    Note that certain server controls html encode by default depending on certain properties that are set.

  5. #5

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [2005] Porbably an encoding problem

    That'd be correct if I was always getting the html code for special characters. but the disturbing thing is this only happens sometimes. Most of the time I get the data correctly.

    And to be specific I have 1 DB server, 2 different (windows 2003) hosting servers.

    Could this be system settings on one of the servers? Is there a way to find out?
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  6. #6
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: [2005] Porbably an encoding problem

    So on the same page, with the same exact data, sometimes the characters are encoded and sometimes they are not? So you're suspicious of a configuration difference between the two 2k3 web servers?

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Porbably an encoding problem

    Start by... comparing the machine.configs on both machines. Use something like windiff. I don't know if that should make a difference though. But try it anyways.

  8. #8

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [2005] Porbably an encoding problem

    Quote Originally Posted by nemaroller
    So on the same page, with the same exact data, sometimes the characters are encoded and sometimes they are not? So you're suspicious of a configuration difference between the two 2k3 web servers?
    Yes

    Quote Originally Posted by mendhak
    Start by... comparing the machine.configs on both machines. Use something like windiff. I don't know if that should make a difference though. But try it anyways.
    I'll try that tomorrow, I hope it works
    Last edited by ComputerJy; Oct 2nd, 2007 at 12:56 PM.
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Porbably an encoding problem

    Of course it won't. Don't be so optimistic.

    Also, I know it's a little anal, but can you post a screenshot of similar scenarios where it's working and where it isn't? Also, when it starts showing weird characters, can you get the HTML source of that rendered page and put it up here, probably in a .txt file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width