Recent

Author Topic: (SOLVED) Lazarus + Firebird + Emoji  (Read 3478 times)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Lazarus + Firebird + Emoji
« Reply #15 on: January 12, 2021, 04:57:41 am »
I have searched around and for mysql it seems that utf8 is not enough, it must become utf8mb4. I just don't know how to set it up in firebird when creating the database.
What is utf8mb4? ... OK, I can find it in the net :

UTF-8 is a variable-length encoding. In the case of UTF-8, this means that storing one code point requires one to four bytes. However, MySQL's encoding called "utf8" (alias of "utf8mb3") only stores a maximum of three bytes per code point. ...
...  As of MySQL 5.5.3, the utf8mb4 character set uses a maximum of four bytes per character supports supplemental characters

WTF! They already handle a variable length encoding but then leave the last byte out. Why? Totally stupid.
What is the connection between Firebird and MySQL? I thought they are separate DBs. I am not a DB expert as you can see.
Correct. MySQL and Firebird are separate DBs, but MySQL's original transaction implementation was designed by Jim Starkey* via Falcon (Storage Engine for MySQL):
https://www.firebirdnews.org/jim-starkey-introducing-falcon-storage-engine-for-mysql/
https://www.firebirdnews.org/mysql-falcon-storage-engine-open-sourced-on/

* Jim Starkey is known as the father of Interbase, whose fork in 2000 would become Firebird.


The Firebird documentation (see here) says that utf8 reserves four bytes.
To be precise: "Keep in mind that one UTF8 character occupies up to 4 bytes, thus limiting the size of CHAR fields to 8,191 characters (32,767/4)."

Quote
That utf8mb4 is something specifically created by MySQL, as from the start they didn't support utf8 correctly.
Correct.

devEric69

  • Hero Member
  • *****
  • Posts: 648
Re: Lazarus + Firebird + Emoji
« Reply #16 on: January 29, 2021, 11:33:58 am »
Are you sure?

I have checked 5 releases in the last 6 months, being 2 in the last 10 days:
https://github.com/mariuz/flamerobin/releases

Indeed, I was completely wrong.

It had been a while, since I didn't see a new release of http://flamerobin.org/ (indeed, a new version was released on January 11, 2021; and the \ a FlameRobin's developer has just posted on this forum: https://forum.lazarus.freepascal.org/index.php/topic,52908.msg392293.html#msg392293).

I apologise to him. What i've said is stupid, if i consider the existence of refactoring techniques (Cf. Martin Fowler), if need be...
 :-[  :-[  :-[
« Last Edit: January 29, 2021, 11:52:51 am by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

 

TinyPortal © 2005-2018