Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
¿Cómo leer texto en chino desde una base de datos usando DBI?

Tengo una base de datos con una lista de artículos en chino y tengo un problema cuando intento hacer mi consulta para obtener todos los nombres de los artículos, todo lo que veo es ??? y no el texto chino.

 my $db_connection = DBI->connect("DBI:mysql:host=localhost;database=articles", 'root', ''); my $con = $db_connection->prepare( "select * from articles" ); $con->execute; while (my $infoD = $con->fetchrow_hashref()) { $INFO{$infoD->{name}} .= decode('utf8', $infoD->{name}); }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

declare en su cadena de conexión también que debería usar utf8

 DBI->connect("DBI:mysql:host=localhost;database=articles", 'root', '',{mysql_enable_utf8 => 1});

Si tienes utf8mb4

tienes que reemplazar {mysql_enable_utf8 => 1} con {mysql_enable_utf8mb4 => 1}

Editar:

también vea aquí UTF8 hasta el final

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!