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

353
Vistas
Apache won't working on UTF-8 how can I solve this

I've installed apache on my windows 10 and set the things for python and it can run .py files thats ok. But however I can't use the letter "ş" cause apache encode is not setted for utf-8 but I already added the AddDefaultCharset UTf-8 in my httpd.conf file. But when I try to open my index file I'm getting this error

UnicodeEncodeError: 'charmap' codec can't encode character '\\u015e' in position 554: character maps to <undefined>\r: C:/www/index.py

So how can i solve this problem?

and this is my index file

#!C:\Users\doganalisan\AppData\Local\Programs\Python\Python39/python.exe
import page_elements as pe
import background
print("Content-Type: text/html\n\n")
print("""
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Semanur ŞAN</title>
<script src="https://kit.fontawesome.com/657430e951.js" crossorigin="anonymous"></script>
</head>
<body id="index">
<div class="container">
 """ + pe.header + """
 """ + pe.mobile_header+ """
 """ + str(background.indexaboutside()) + """
</div>
""" + pe.footer + """
</body>
</html>
""")

I've found the solution its so simple just adding this code on my files and its working fine

import sys
sys.stdout.reconfigure(encoding='utf-8')
over 4 years ago · Santiago Trujillo
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