From 306cef4b49fa20b3ed2031261988b8bf80320080 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 18 Jan 2010 11:18:59 +0000 Subject: [PATCH] correção na codificação de caracteres --- kml.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kml.php b/kml.php index b7f6fc5..638bf19 100644 --- a/kml.php +++ b/kml.php @@ -42,10 +42,14 @@ error_reporting(0); include_once ("classesphp/carrega_ext.php"); include_once ("classesphp/classe_menutemas.php"); include_once ("ms_configura.php"); +include_once ("admin/php/conexao.php"); +$encoding = "ISO-8859-1"; +if($convUTF == true) +{$encoding = "UTF-8";} if(!isset($idioma)) {$idioma = "pt";} echo header("Content-type: application/xml"); -echo ''; +echo ''; echo "\n"; // //pega os endereços para compor a url de chamada do gerador de web services @@ -287,7 +291,8 @@ function kml_networklink($nome,$fonte,$legenda,$desc,$href) } function kml_converteTexto($i) { - $encoding = mb_detect_encoding($i, 'UTF-8, UTF-7, ASCII, ISO-8859-1'); - return mb_convert_encoding($i,"UTF-8",$encoding); + global $encoding; + $encodingatual = mb_detect_encoding($i, 'UTF-8, UTF-7, ASCII, ISO-8859-1'); + return mb_convert_encoding($i,$encoding,$encodingatual); } ?> \ No newline at end of file -- libgit2 0.21.2