3
I load 3 Strings from a CMS.
String Data da Noticia
String Titulo da Noticia
String Texto da Noticia
Within a loop, create the query to insert with these 3 strings.
I’m just having some problems.
1º) The string Texto da Noticia, has characters like "-" and " ' to solve, I used replace
. But I would have some way of inserting, without having to take these characters from the text of the news?
2º)Characters accentuated in the text of the news as "ç", "is" , "á" are being saved in the bank as a " ? "
I tried to use that:
pstmt = con.prepareStatement("SET NAMES 'utf8'");
pstmt.executeUpdate();
pstmt = con.prepareStatement("SET CHARACTER SET utf8");
pstmt.executeUpdate();
But it does not solve. In the bank I also set to utf8 and unicod.
Does anyone know how to solve these 2 problems?
What kind of database are you using? What programming language are you using?
– Jorge B.
I load the contents of a CMS into a JSP page. And export to Mysql database.
– Bruno
Try exporting the strings in UTF-8 or Unicode. I had a similar problem with SQL Server and this "conversion" worked.
– Elexsandro Rangel dos Santos
How do you export in these formats?
– Math
In the question Bruno is using Mysql, this is valid also in it?
– gmsantos