Previous Next

Thread: IIS Log encoding for ANSI non-English codepage

Last post 05-15-2008 11:45 AM by anilr. 11 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (12 items)

Sort Posts:

  • 05-02-2008, 4:27 AM

    • roberthu
    • Top 500 Contributor
    • Joined on 03-10-2008, 3:23 PM
    • Posts 9
    • roberthu

    IIS Log encoding for ANSI non-English codepage

    Hi there,

    Recently I migrate website from IIS 6 to IIS 7, everything goes well but 1 thing. The non-English ANSI Characters in IIS log appears like ??????

    I try with ASP and ASP.Net and both integrated and class app pools with following links:

    http://localhost/test/test.asp?kw=中文測試
    http://localhost/test/test.aspx?kw=中文測試

    In IIS log both requests cs-uri-stem are kw=????????

    I also try to change log encoding from UTF-8 to ANSI, but no luck.

    How can I set up IIS log to store these non-English ANSI characters? Thanks.

     - Robert Hu

    ps:

     It is not cs-uri-stem, it is cs-uri-query not proper encoded.

  • 05-03-2008, 1:24 AM In reply to

    Re: IIS Log encoding for ANSI non-English codepage

    Why don't you use the default utf-8 encoding IIS 7.0 logging uses?  Wouldn't that account for non-English characters?

    Steve Schofield
    Windows Server MVP - IIS
    MCTS - Windows Hosting

    http://weblogs.asp.net/steveschofield
    http://www.iislogs.com
    http://www.orcsweb.com/
    Managed Hosting Solutions
    #1 in Service and Support
  • 05-03-2008, 11:35 PM In reply to

    • qbernard
    • Top 10 Contributor
    • Joined on 03-26-2003, 2:12 AM
    • Malaysia
    • Posts 2,193
    • IIS MVPs
    • qbernard

    Re: IIS Log encoding for ANSI non-English codepage

    Using default utf-8 encoding, you can log non-ascii char for cs-uri-stem, but not cs-uri-query.
    e.g. in the log file.
    ::1 GET /测试.asp kw=???

    Mm.. so why query string not encoded?

    Cheers,
    Bernard Cheah
  • 05-08-2008, 6:54 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 938
    • anilr

    Re: IIS Log encoding for ANSI non-English codepage

    I tested this and it seems to be an IE issue on vista/ws08 - I collected netmon trace and the actual query-string going on the wire is ???? - have you tried testing from downlevel IE to IIS7?

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-08-2008, 11:03 PM In reply to

    • roberthu
    • Top 500 Contributor
    • Joined on 03-10-2008, 3:23 PM
    • Posts 9
    • roberthu

    Re: IIS Log encoding for ANSI non-English codepage

    No, but IIS 6 doesn't have same problem so I believe IIS 7 should behave the same. If not, it should be IIS 7's problem, not IE problem.

  • 05-09-2008, 10:20 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 938
    • anilr

    Re: IIS Log encoding for ANSI non-English codepage

    Did you even read my post?  I took a netmon trace of the packet on the wire and IE is sending ????'s in the query-string.  Have you tested vista/ws08 client against IIS6 or ws03/xp client against IIS7?

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-10-2008, 1:45 AM In reply to

    • roberthu
    • Top 500 Contributor
    • Joined on 03-10-2008, 3:23 PM
    • Posts 9
    • roberthu

    Re: IIS Log encoding for ANSI non-English codepage

    .

    anilr:

    Did you even read my post?  I took a netmon trace of the packet on the wire and IE is sending ????'s in the query-string.  Have you tested vista/ws08 client against IIS6 or ws03/xp client against IIS7?

     

    I did read your post and you didn't get my meaning.

    The same client machine (Vista+IE7) can send same request to IIS 6 and IIS 6 log the non-English characters correctly. So I believe it doesn't the client issue.

    If you follow the thread you can see qbernard's post mention this issue happened to Simplified-Chinese too. This issue could effect the adoption of Windows 2008/IIS 7 in non-English world, which I believe is bigger than English world.

    If you are from IIS team, you should test and answer why IIS 7 cannot log non-characters in log correctly and not challenge why we don't use vista or xp as client

  • 05-11-2008, 10:21 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 938
    • anilr

    Re: IIS Log encoding for ANSI non-English codepage

    From my test, vista+IE7 is not sending the english characters to IIS7 server on ws08 - I have no idea why - there is nothing IIS can do to log what it has not received.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-12-2008, 6:04 AM In reply to

    • roberthu
    • Top 500 Contributor
    • Joined on 03-10-2008, 3:23 PM
    • Posts 9
    • roberthu

    Re: IIS Log encoding for ANSI non-English codepage

    I do more testes to clarify the issue.

    Here is the code in both ASP and ASP.Net

    <% Response.Write(Request("kw")) %>

    Here are the request for ASP and ASP.Net

    http://localhost/test.asp?kw=中文測試
    http://localhost/test.aspx?kw=中文測試

    Here are the results:

    1. ASP: ASP doesn't have display issue, it can display Chinese Characters correntcly

    IIS7+ASP

    2. ASP.Net

    By default setting (.Net Globalization = UTF8, App Pool in Integrated Mode) ASP.Net can not display Chinese characters:

    IIS7+ASP.Net-Default

    After changing App Pool from Integrated to classic and .Net Globalization requests encoding from UTF-8 to big5, the Chinese characters display correctly

    IIS7+ASP.Net+Big5

    But in both cases neigher correctly log cs-uri-query in log files

     IISLog

    Conclusion:

    There are some encoding issue in ASP.Net in integrated app pool and IIS Log. Hope these testes can help IIS team to figure out what goes wrong.

  • 05-12-2008, 12:51 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 938
    • anilr

    Re: IIS Log encoding for ANSI non-English codepage

    The integrated mode asp.net issue is an asp.net bug discussed here which will be fixed in the next asp.net service pack.

    As for the original logging issue - can you give me the exact bytes of the url you are requesting?  I am unable to get IE to send a url with unicode characters if I just cut and paste the url from your post.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 05-15-2008, 6:02 AM In reply to

    • qbernard
    • Top 10 Contributor
    • Joined on 03-26-2003, 2:12 AM
    • Malaysia
    • Posts 2,193
    • IIS MVPs
    • qbernard

    Re: IIS Log encoding for ANSI non-English codepage

    Oops.. just got back. been busy.
    My vista is not with me now - traveling, so have not try the downlevel IE with IIS 7.

    So  Anil, this is IE issue as it is not sending in encoded format ?

    Cheers,
    Bernard Cheah
  • 05-15-2008, 11:45 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 938
    • anilr

    Re: IIS Log encoding for ANSI non-English codepage

    Probably not, clearly roberthu has gotten IE to send the unicode characters to IIS since his asp page echoes it back correctly - I have not been able to do it when I cut-n-paste the characters from this webpage into IE - maybe some problem with cut-n-paste.

    So, I still need to set up a repro.  Peter huang did send me the exact unicode hex digits for this repro in a separate e-mail - I just need to give it a try.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (12 items)
Page view counter