Mar-04-2019, 07:18 AM
Python 3.7.2
I write the strings from my Python code into my database. My strings contain Latin and Cyrillic characters, so in the database I use 1-byte encoding koi8-r. The miracle is that my strings without distortion are written to the database, although utf8 and koi8r have completely different sequence of characters (for example, as in ascii and utf8). Sometimes characters of other layouts appear in the text and then write errors appear.
Therefore, the questions appear:
1. Who converts strings: the database or the aiomysql library, that I use to write to the database.
2. How quickly in Python / MariaDB to remove non-koi8-r characters to avoid errors.
Thank you in advance for participating in the conversation.
Perhaps, there are databases that support an "economical" (for my case) multibyte encoding, which stores the Latin and Cyrillic characters in the first byte, and other layouts in other bytes?
I write the strings from my Python code into my database. My strings contain Latin and Cyrillic characters, so in the database I use 1-byte encoding koi8-r. The miracle is that my strings without distortion are written to the database, although utf8 and koi8r have completely different sequence of characters (for example, as in ascii and utf8). Sometimes characters of other layouts appear in the text and then write errors appear.
Therefore, the questions appear:
1. Who converts strings: the database or the aiomysql library, that I use to write to the database.
2. How quickly in Python / MariaDB to remove non-koi8-r characters to avoid errors.
Thank you in advance for participating in the conversation.
Perhaps, there are databases that support an "economical" (for my case) multibyte encoding, which stores the Latin and Cyrillic characters in the first byte, and other layouts in other bytes?