DBD-mysqlx

 view release on metacpan or  search on metacpan

dbdimp.c  view on Meta::CPAN


#include "dbdimp.h"

DBISTATE_DECLARE;

/* Check if a collation is using UTF-8
 *
 * To get the ID's:
 * SELECT ID FROM information_schema.COLLATIONS WHERE CHARACTER_SET_NAME LIKE
 * 'utf8%' ORDER BY IS_DEFAULT DESC, COLLATION_NAME LIKE '%\_general\_%' DESC,
 * COLLATION_NAME LIKE '%\_bin%' DESC, COLLATION_NAME LIKE '%\_unicode\_%' DESC,
 * COLLATION_NAME LIKE 'utf8mb4_0900\_%' DESC
 *
 * Note that default and generic collations are moved to the front of the list
 */
bool dbd_mysqlx_is_utf8_collation(uint16_t collation) {
  uint16_t utf8collations[] = {
      33,  255, 223, 45,  83,  46,  192, 246, 224, 214, 305, 278, 199, 207, 215,
      228, 236, 244, 259, 267, 277, 285, 293, 200, 208, 229, 237, 245, 260, 268,
      286, 294, 306, 193, 201, 209, 230, 238, 261, 269, 279, 287, 296, 307, 194,
      202, 210, 231, 239, 247, 262, 270, 280, 288, 297, 195, 203, 211, 232, 240,



( run in 0.802 second using v1.01-cache-2.11-cpan-88abd93f124 )