I've got an answer from JSTL team.
Here it is

Here is my take:
>
>    1. Jakarta Tags Specification Section 7.4 details the <c:import> tag:
>    c:import
>    
> <https://github.com/eclipse-ee4j/jstl-api/blob/master/spec/src/main/asciidoc/jakarta-stl.adoc#74-cimport>
>
> Within this, it details the following: Character Encoding : The
> <c:import/> for import-encoded.txt does not include an encoding so the
> default encoding is used: ISO-8859-1
>
>    1. If I were to do the following: <c:import url="import-encoded.txt"
>    charEncoding="UTF-16"/> then we would not see the BOM since the proper
>    encoding is used and would see the actual text in the file rather than
>    garbled characters which is what the test is actually looking for, see
>    below.
>
> This test is just checking the following:
>
> <%-- If encoding is not specified, and no encoding is specified in the
>      response of the imported resource, the default of ISO-8859-1
>      will be used. --%>
>
> As to whether or not to strip the BOM when the content type of the file
> uses a BOM and the content type being used does not use a BOM I disagree
> that it should be removed, and here is why:
>
>    -
>
>    The encoding defaults to ISO-8859-1 which as far as I know doesn't use
>    the BOM so just including the text as is in the <c:import/> seems
>    reasonable to me.
>    -
>
>    Tomcat remove the BOM from the file even when the ISO-8859-1 encoding
>    is used to read the UTF-16 encoded text which I don't see how that
>    improves anything. It sounds like this is stripped outside of any Jakarta
>    Tags or Jakarta Pages specification and is done as a specific change to
>    Tomcat since Tomcat last was executed against the TCK.
>
> At this point from a Jakarta Tags perspective, I believe the golden file
> is correct.
>





Le mer. 14 avr. 2021 à 10:16, Jean-Louis MONTEIRO <jeano...@gmail.com> a
écrit :

> Thanks for the answer.
>
> Do you mind adding the comment in the issue?
> I can copy/paste if not. It's just to give context to others
>
> Thanks
>
> Le mar. 13 avr. 2021 à 21:44, Mark Thomas <ma...@apache.org> a écrit :
>
>> On 13/04/2021 20:17, Jean-Louis MONTEIRO wrote:
>> > Hi guys,
>> >
>> > I have one JSTL issue and I'd need your feedback on it.
>> > https://github.com/eclipse-ee4j/jstl-api/issues/140
>> >
>> > Can you guys have a look and let me know what you think?
>>
>> That looks like a side-effect of the various improvements we made to the
>> Default Servlet to do a better job of including content with a variety
>> of (potentially incompatible) encodings.
>>
>> Generally, I'd expect the BoM to be skipped.
>>
>> Historically, Tomcat didn't skip the BoM, so the original golden file
>> was generated on that basis.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
>>
>
> --
> Jean-Louis
>


-- 
Jean-Louis

Reply via email to