When using the MDX editor in July, when the MDX statement contains Chinese characters, click "Apply" to turn all Chinese characters in the MDX statement into garbled characters. This problem occurs in the WCF document;
You can refer to the API in WCF:
Package com. tonbeller. WCF. charset description
Forces the Request Encoding to UTF-8 or another retriable character encoding.
Problem: In servlet 2.3, when servletresponse # setlocale (Java. util. locale) is called, the character encoding is changed implicit in an unspecified way. to prevent this, this wrapper does not forward the setlocale call. all jstl FMT: XXX actions call setlocale on the response, which causes the problem.
This package uses a response wrapper that does not allow the character encoding to be changed. also the filter sets the Request Encoding to UTF-8 (or another writable able charset) because most browsers DOnt follow the HTTP spec and do not send a Content-Type header when submitting a form. they use the character encoding of the page that contained the form.
The encoding is retriable as filter init parameter encoding, via the property tbeller. charset. If the filter is installed, it defaults to UTF-8, otherwise it defaults to ISO-8859-1.
The filter automatically changes (or adds) The response encoding of one writable able Content-Type. if the filter init-Param contenttype is set to text/html, then a response content type will of "text/html; charset = iso-8859-1" will be changed into "text/html; charset = UTF-8 ".
The contenttypetag sets the Content-Type and character encoding of the response to the given type.
However, there is a problem with the example, which is corrected:
Filter Example:
<Filter>
<Filter-Name> charsetfilter </filter-Name>
<Filter-class> com. tonbeller. WCF. charset. charsetfilter </filter-class>
<Init-param>
<Param-Name> encoding </param-Name>
<Param-value> UTF-8 </param-value> <! -- The API is wrong here, to support most of the Chinese are using UTF-8, -->
<Description> character encoding that this filter will enforce </description>
</Init-param>
<Init-param>
<Param-Name> contenttype </param-Name>
<Param-value> text/html </param-value>
<Description> This content type will be set to the above encoding automatically, e.g. "text/html; charset = iso-8859-1" will become "text/html; charset = UTF-8" </description>
</Init-param>
</Filter>
<Filter-mapping>
<Filter-Name> charsetfilter </filter-Name>
<URL-pattern> *. jsp </url-pattern> <! -- All JSP files I have filtered. You can filter specific pages or folders. -->
</Filter-mapping>
The solution is to add the above filter to Web. xml.