From edb981fcb63ce8e2011d6900f903fa7d366c9ac5 Mon Sep 17 00:00:00 2001 From: Banana Date: Tue, 8 Oct 2024 11:12:14 +0200 Subject: [PATCH] possible utf8 fixes Signed-off-by: Banana --- crawler/cleanup.pl | 3 ++- crawler/fetch.pl | 3 ++- crawler/parse-results.pl | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crawler/cleanup.pl b/crawler/cleanup.pl index 4dce87c..df73b06 100644 --- a/crawler/cleanup.pl +++ b/crawler/cleanup.pl @@ -38,7 +38,8 @@ die "Could not read config! $ConfigReader::Simple::ERROR\n" unless ref $config; ## DB connection my %dbAttr = ( PrintError=>0,# turn off error reporting via warn() - RaiseError=>1 # turn on error reporting via die() + RaiseError=>1, # turn on error reporting via die() + mysql_enable_utf8mb4 => 1 ); my $dbDsn = "DBI:mysql:database=".$config->get("DB_NAME").";host=".$config->get("DB_HOST").";port=".$config->get("DB_PORT"); my $dbh = DBI->connect($dbDsn,$config->get("DB_USER"),$config->get("DB_PASS"), \%dbAttr); diff --git a/crawler/fetch.pl b/crawler/fetch.pl index 3110158..3a57d7c 100644 --- a/crawler/fetch.pl +++ b/crawler/fetch.pl @@ -41,7 +41,8 @@ die "Could not read config! $ConfigReader::Simple::ERROR\n" unless ref $config; my %dbAttr = ( PrintError=>0,# turn off error reporting via warn() RaiseError=>1, # turn on error reporting via die() - AutoCommit=>0 # manually use transactions + AutoCommit=>0, # manually use transactions + mysql_enable_utf8mb4 => 1 ); my $dbDsn = "DBI:mysql:database=".$config->get("DB_NAME").";host=".$config->get("DB_HOST").";port=".$config->get("DB_PORT"); my $dbh = DBI->connect($dbDsn,$config->get("DB_USER"),$config->get("DB_PASS"), \%dbAttr); diff --git a/crawler/parse-results.pl b/crawler/parse-results.pl index 9a785d5..c91efd3 100644 --- a/crawler/parse-results.pl +++ b/crawler/parse-results.pl @@ -42,7 +42,8 @@ die "Could not read config! $ConfigReader::Simple::ERROR\n" unless ref $config; my %dbAttr = ( PrintError=>0,# turn off error reporting via warn() RaiseError=>1, # turn on error reporting via die() - AutoCommit=>0 # manually use transactions + AutoCommit=>0, # manually use transactions + mysql_enable_utf8mb4 => 1 ); my $dbDsn = "DBI:mysql:database=".$config->get("DB_NAME").";host=".$config->get("DB_HOST").";port=".$config->get("DB_PORT"); my $dbh = DBI->connect($dbDsn,$config->get("DB_USER"),$config->get("DB_PASS"), \%dbAttr); -- 2.39.5