httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Biggs <>
Subject [users@httpd] Using SSI to include a UTF-8 encoded file causes a strange character to be sent to the browser
Date Wed, 07 Oct 2009 08:20:01 GMT


    Apache 2.2.13
    Windows XP SP3


    My intention is to use SSI to include one html file in another. The text in both can be

    either English or Russian - or a combination. So I used UTF-8 encoding for the files as

    it seemed to be the right thing to do.


    The two files HTML files that can be used to demonstrate this problem are as follows:


          <table border="1"><tr><td nowrap><!--#include virtual="/en_US/Pages/utf8.utf8"


    As can be seen outer.shtml includes the file utf8.utf8.

    When these files are saved as "ANSI" (using Notepad) and call the included file "something.htm",
    they display correctly in a browser as you would expect. However, when I save them as
    (again using Notepad) I seem to get a strange character sent to the browser, just before
    start of the included file.  I have attached the file received by the browser. (see outer[1].txt
    in the attached zip file). As you may be able to see there is an "odd" character between

    "<td nowrap>" and "<table>. This has the effect of pushing the inner table
down a line which 
    is not wanted.

I have modified the httpd.conf only to allow me to have 4 virtual hosts, enable SSI and, when
noticed the problem, I also uncommented the line:

    Include conf/extra/httpd-languages.conf

As part of by attempt to fix the problem, I have also added .shtml to a line in the above
as follows:

    AddCharset UTF-8   .utf8 .shtml

However, nothing seems to stop this odd character being presented to the browser.

If you could provide some help or guidance to solve this problem - or perhaps suggest whether

this is a bug and should be logged, I would be grateful.

Many Thanks for your attention thus far.
Christopher Biggs

View raw message