Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
How to set encoder to PHP PDO

I'm using Php5.6.2 And postgres as database connection. postgres is set to UTF-8

i was try to select db, but it return error "SQLSTATE[22021]: Character not in repertoire: 7 ERROR: invalid byte sequence for encoding "EUC_JP": 0xe58e"

$this->db = new PDO("pgsql:host=localhost;dbname=test","cadusr","cadpass");

Some query is working successfully, but some are not. I expect that maybe the fail queries are include Japanese.

Can i get some teaching? Thank you.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Sorry self answer as soon as ask.

Before asking, I found only English web with error message.

But i could find after asking easily Japanese web with keyword PHP PDO pgsql. So, This is solution.

Add this line of code below in host after ip.

options='--client_encoding=UTF8'

new PDO("pgsql:host=localhost  options='--client_encoding=UTF8';dbname=test","cadusr","cadpass");

Hope that help you.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda