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

203
Views
Express y Node Server no reconocerán caracteres UTF-8

Espero que lo estás haciendo bien. Hoy tengo este problema: tengo estas 2 funciones:

 const search_words = async (word, question) => { let options = { method: 'GET', url: `https://google.com/complete/search?client=psy-ab&gl=fr&lr=lang_fr&q=${word}%20${question}`, headers: { 'Accept': 'application/json; charset=utf-8', 'Content-Type': 'application/json', } }; return axios.request(options).then(function (response) { console.log(response.data[1]) return response.data[1] }).catch(function (error) { console.log(error); }); } app.post('/api/related-questions', async (req, res) => { const question = req.body.question let questionsReturn = {} let qui = search_words('qui', question).then(res => questionsReturn['qui'] = res) let quoi = search_words('quoi', question).then(res => questionsReturn['quoi'] = res) let pourquoi = search_words('pourquoi', question).then(res => questionsReturn['pourquoi'] = res) let que = search_words('que', question).then(res => questionsReturn['que'] = res) let ou = search_words('ou', question).then(res => questionsReturn['ou'] = res) Promise.all([qui, quoi, pourquoi, que, ou]).then(() => { res.json(questionsReturn) }) })

Si hago la solicitud a la API de Google con Postman, obtendré las búsquedas con los caracteres correctos: ingrese la descripción de la imagen aquí

Pero cuando lo hago con Axios y mi función, obtengo estos caracteres: ingrese la descripción de la imagen aquí

¿Me falta alguna configuración? Gracias por leer <3

about 4 years ago · Juan Pablo Isaza
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!