I have an angular app being deployed from a weblogic 8 server. However in UAT there is an encoding issue in one of the html files. We have ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ
in an ng-pattern for validation but when we look at it using developer tools some of them are being interpreted as □?.
I have saved the html file as UTF-8 and run Jenkins. As part of our build process a grunt command runs that combines all our js and htlm into one file. Visual inspection of this file shows that the encoding is still good. The .js file produced is UTF-8 and there are no □? symbols.
I think the browsers in UAT are reading the file as ISO-8895 encoding instead of UTF-8. I found a solution. By setting the content-type http header to "text/html; charset=utf-8"
I can force the browser to use the right encoding. I couldn't find a config in weblogic 8 to set this header so I made the following servlet filter:
This works in tomcat and for .do struts files in weblogic but not for .html files. Debugging through the code shows that the header is being set to "text/html; charset=utf-8"
but then weblogic is resetting it to "text/html"
.
Is there a way to set the content-type http header in weblogic 8? Or a way to stop it overwriting "text/html; charset=utf-8"
with "text/html"
?
Is this servlet filter approach the wrong way to approach this encoding issue?
Here are the steps on how encode in WebLogic server
Here are more how to put as default in other servers UTF-8 Configuration and here is the documentation of how to Internationalization in WebLogic Documentation of Weblogic I hope this helps. Well if the script doesn't work try this to adding to your
weblogic.xml
:Check this doc for the configuration of the
weblogic.xml
weblogic.xml Doc