Wicket - question marks when inserting cyrillic characters to the database - database

I am using wicket, spring and mysql. When I try to insert cyrilic characters to the database instead of the characters I see question marks ('?????').
When I use the i18n files I don't have such kind of problem. Also, when inserting characters from other place (i.e. mysql workbench) there is no problem. In other words, the problem is not in the database. The database and my html documents are in utf-8.
Could you please help me solve this problem.
Cheers!
Nikolay

Wicket has two more encoding-related settings, try this (in you Application initialization):
getMarkupSettings().setDefaultMarkupEncoding("utf-8");
getRequestCycleSettings().setResponseRequestEncoding("utf-8")

Related

Flutter offline database

I am beginner in python and Flutter (4 months that i actually code) self-taught . There is a lot of information and I am facing a problem. I don't know how to go about it.
I am building a dictionary app in Flutter. I extracted all the words and definitions from the French Wiktionary with Scrapy and I processed all the data with pyspark. All data was inserted into an ObjectBox database with python and which has a final size of 460 mb for 355,000 elements. I compressed it with Brotli and its final size is 65 mb. So I end up with a compress mdb file. And now I'm stuck.
I thought of extracting the database to read it live with ObjectBox in Flutter but it does not read the mdb files directly and it gets complicated, I can't find any documentation on the subject. Moreover I tell myself that if the live extraction is not done on the internal memory, it will reserve ram? (If I understood correctly) This will not lead to a crash?
Or is it possible to extract it when installing the App so that objectBox can read it directly?
Or maybe I'm scratching my head over nothing. Directly read a Json but I'm afraid that the queries will be long because the word search is live for the user That this one writes a letter, my program must return me the words beginning with this one.
What would you do to maximize performance in the background ? Thanks for your help .
welcome on StackOverflow! :)
I think your question is a duplicate of this one:
How setup dart objectbox with a local database pre-populated?
as long as you refer to this NoSQL database by ObjectBox in both python and flutter and you're trying to use this package in the former and this in the latter.
Is that the case? Does the answer on the other question help you? If not, can you pls. elaborate what's missing/failing?
In general if you add a few links/references + narrow down the number of things/topics you ask might help (you can ask follow-up questions in comments later on answers or just post a new question if you still need infos). Not that I'm a pro here, could just make it easier for others to answer IMHO.

Django MsSQL FreeTDS - Nvarchar(max) Auto Truncates

I'm using Django that is connected to AWS' RDS MSSQL. So I'm to input very long texts, but they are generally longer than 4000 characters. In Django, this specific field is using TextField and the data type in MSSQL is nvarchar(max). So my question now is how can I configure and increase its max length. I've got the assumption that it's supposed to be infinite (of course it's not).
Help is desperately needed. I've read about it briefly here: How to get entire VARCHAR(MAX) column with Python pypyodbc. However, I'm using RDS and I have no idea in doing this as at all.
Thank you all in advanced!
If you are using django-pyodbc-azure, upgrading from 1.11.11.0 to 1.11.13.1 fixed the issue for me.

Problems in storing multilingual website data into database

I am making a multilingual website and storing data into database. The problem I am facing is, some of the character in some languages other then English are not being inserted into data base. For example if I enter "cliënten" [Dutch language] into form text area or input box, when I submit this. it only insert "cli" but nothing after this character ë the problem is clear. it seems a special charterer.
Now can anybody tell me how to insert characters like this into database from all other languages?
Thanks in advance to all you experts out there.
:-)
You could start by checking the character set and the collation of the database. If you are using phpMyAdmin, open the database and you will probably see a column titled 'collation' for each of the tables. Ideally I think you will want utf8.
More info: http://dev.mysql.com/doc/refman/5.6/en/charset-database.html
If the database looks good, then if you are loading details via a web page, check that you have specified the charset there as well with something like this in the page head:
<meta charset="UTF-8">

Character issue in WordPress site

I have a problem with a WordPress site (it's in Swedish). For some reason I can't use all characters when I'm writing posts - the characters å, ä and ö become Ã¥ ä ö. The site is a webshop and I have the Woocommerce plugin installed. The same problem with åäö occurs in the long product descriptions of Woocommerce.
Anyone know what I can do to solve this? The character encoding in WordPress admin panel is set to UTF-8 and so is the database charset in wp-config.
In the database in phpmyadmin the collation of the wp-posts tables are set to "utf8_general_ci". Is that the problem?
This thing has never happened to me before, even though I have built a lot of WP sites in the past. Therefore I don't know what to do. Maybe the solution is simple but I want to know what I'm doing before doing anything so I don't risk messing up the site.
Would really appreciate some help with this, thanks.
When "national special characters", ie. non-ASCII characters, are displayed wrong, you probably have an error related to charset. The easiest way to fix this is usually to make sure that you are using UTF-8 everywhere.
(For Swedish in particular, you can use ISO-8859-1 (worst), ISO-8859-15 (better) or UTF-8 (best).)
You need to use the same charset everywhere, from the database to the HTML declaration.
In your theme's header.php file, please make sure that the declared charset is
UTF-8.
In your text editor or on your server, please make sure your theme files are being saved as UTF-8.
In MySQL, please make sure that the table schema is set to use utf-8.
In MySQL, please make sure that connections default to use UTf-8: mysql --default-character-set=utf8
In PHP, try setting the connection to utf-8 with mysqli_set_charset
In order to fix the Character Encoding Mismatch Problem in WordPress,
Open the ‘wp-config.php’ file in a text editor(the wp-config.php file can be found on the directory where you installed WordPress).
Find the following two lines and comment them out:
define(‘DB_CHARSET’, ‘utf8′);
define(‘DB_COLLATE’, ”);
They should look like the following after you comment them out:
//define(‘DB_CHARSET’, ‘utf8′);
//define(‘DB_COLLATE’, ”);
Now upload the updated ‘wp-config.php’ file to your webhost.
This character encoding problem can happen after a database upgrade too so it doesn’t hurt to keep this trick in your mind just in case.
In another case, if you are using PHP Dom (loadHTML) somewhere, there is a need to load HTML as UTF-8. I have fixed it by:
Replacing
#$dom->loadHTML($html);
to
#$dom->loadHTML('<?xml encoding="UTF-8">' . $html);

How to store data from a richtexteditor to accommodate searches?

We're considering adding rich text editing to our system. I understand we'll get a heavily tagged string from our textareas. But I wonder about database searches for text within that data. There might be non-html tags containing versioning comments or other stuff that we wouldn't want to be searched.
How does something like this get implemented? Do we store the data twice, once with tags and once without? Or are there sql server tools to help skip tags during searches that won't kill us performance-wise?
(We're on sql server 2005 now, moving to 2008)
I would probably use full text search and include all HTML tags as stopwords. You can read more about these here.
Good luck!

Resources