Answer the question
In order to leave comments, you need to log in
How to deal with the Cyrillic record in the database?
I can save/edit data in a table from the database, if I enter Russian text, it saves it in this form:
Ð²Ð¾Ñ Ñак ÑоÑÑанÑеÑÑÑ ÑÑÑÑкий ÑекÑÑ
DB - MySQL, driver connector/J-driver 5.1.1 itself fields utf-8 encoding of the jsf page is also in this encoding.
What to add, I think there are those who had similar problems.
Answer the question
In order to leave comments, you need to log in
the first is the encoding of the web page.
the second is a collation at the base itself.
the third - the coding yes, fields.
There was a similar question, we solved it Why are there question marks instead of Russian letters in PDO when inserting data into the database?
jsf pages are also in this encoding
@WebFilter("/*")
public class CharacterEncodingFilter implements Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
chain.doFilter(request, response);
}
// ...
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true"/>
</jsp-config>
<glassfish-web-app>
<parameter-encoding default-charset="UTF-8" />
</glassfish-web-app>
</glassfish-web-app>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question