法国口音不显示

时间:2019-09-17 14:15:55

标签: angular tomcat utf-8

我有一个可以在码头上完美运行的棱角项目,但是当我将其转移到tomcat时,某些字符无法正确显示,例如'é'=>'é'

为解决该问题,我确实将这些行添加到了我的web.xml

 <filter>
    <filter-name>setCharacterEncodingFilter</filter-name>
    <filter- 
     class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
      <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
     </init-param>
     <async-supported>true</async-supported>
 </filter>
 <filter-mapping>
    <filter-name>setCharacterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
 </filter-mapping>

我确实也将这些行添加到我的cataina.sh

 set JAVA_OPTS="--Xms256m -Xmx1024m -Xss268k -server -XX:MaxPermSize=256m -XX:-UseGCOverheadLimit -Djava.awt.headless=true -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8"

 set CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding='UTF-8'"

以及server.xml的那些行

  <Connector port="8080" maxHttpHeaderSize="8192"
   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
   enableLookups="false" redirectPort="8443" acceptCount="100"
   connectionTimeout="20000" disableUploadTimeout="true" 
   compression="on"  compressionMinSize="128"  
   noCompressionUserAgents="gozilla, traviata" 
   compressableMimeType="text/html,text/xml,text/plain,text/css,text/ 
   javascript,application/x-javascript,application/javascript"
   URIEncoding="UTF-8"/>

在我的JS文件中,它像这样

   {
            label: 'Opportunités', routerLink: 'opportunities', command: 
    function (event) {
                _this.activateMenu(2);
            },
            items: [
                {
                    label: 'Ajouter Opportunité', routerLink: 'ajouterOpr', 
     command: function (event) {
                        _this.activateSousMenu(2, event['item']);
                    }
                },
                {
                    label: 'Opportunités', routerLink: 'opportunities', 
      command: function (event) {
                        _this.activateSousMenu(2, event['item']);
                    }
                }
            ]
        }

但是结果就是这样

enter image description here

请帮助我,我不知道该怎么办

0 个答案:

没有答案