So, I'm trying to enter blog comments into the database for the NLP experiment, but I am having some problems: I use insert preparation instructions, but all single quotes turn into question marks.
I am testing OS X and do not know the character encoding: I assume that it isn_swedish, etc. by default, but after a few hours of scattered Google Googling, I could not figure out how to determine it. I present something like "I did not say this" as a parameter for
PreparedStatement statement = connect.prepareStatement("INSERT IGNORE INTO bwog.article (article_id, date, title, content, url) VALUES (?, ?, ?, ?, ?)"); ... ... String s = "I didn't say that"; //not literal string, but printlns like this statment.setString(4, s);
and it turns into βI didnβt say thisβ in the database after doing all this.
I suppose this is some kind of assumption question in which I did not know or forgot to fulfill some precondition.
SOLUTION: This is a character encoding. The database and tables were in UTF-8, but the command line connection was in latin1 for all the "character_set%" variables, so even though the data was ok, it looked garbled.
source share