Thanks a lot Eric, I read those links and are really interesting.

The solution of the problem was changing the "OEM character conversion"
option of MSSql (see attached image) as Frank answer me in PHP-Windows list.

Original answer of Frank:

-----Original Message-----
From: Frank M. Kromann [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 22, 2008 3:25 PM
To: Leticia Larrosa
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] mssql and latin characters

Hi Leticia,

MS SQL server comes with a set of client tools that allows you to specify
the encoding. There is a checkbox in the Client Network Tool that allows
you to enable/disable OEM character conversion. Flipping that for the alias
you are using to connect to the database should fix the problem.

Remember this must be done on the box where PHP is running if that's
different from the SQL server box.

- Frank


Regards
Leticia Larrosa

-----Original Message-----
From: Eric Butera [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 21, 2008 5:43 PM
To: Leticia Larrosa
Cc: php-general@lists.php.net
Subject: Re: [PHP] mssql and latin characters

On Jan 20, 2008 9:53 PM, Leticia Larrosa <[EMAIL PROTECTED]> wrote:
> Hello
>
>
>
> I have a MSSql 2000 database that have stored data with the follow special
> characters: ó, í, Ñ, á, é, ú.
>
> When I see the data through any MsSql Client I see exactly those
characters.
>
>
> The Collation of database is: SQL_Latin1_General_CP1_CI_AS
>
> I can't change the method of insert data in database.
>
>
>
> When I get (with MSSQL PHP extension) data that have some of those
> characters, I get weird characters instead.
>
>
>
> For example:
>
> A data that in database appears as "Girón" is obtained by PHP as "Gir¢n"
>
>
>
> The problem with the encoding of browser is discarded, because wherever I
> saw the data appears with weird characters.
>
>
>
> The code I use to get the data is:
>
> <?php
>
> mssql_connect('server','user','pass');
>
> mssql_select_db('db');
>
>
>
> $r = mssql_query("select some_column from some_table");
>
> $d = mssql_fetch_assoc($r);
>
>
>
> echo $d['some_column'];
>
> ?>
>
>
>
> My PHP is 4.4.3, and my SO is XP.
>
>
>
> Other people ask the same as I'm and get no answer proper are:
>
>
>
<http://www.psicofxp.com/forums/desarrollo-web.264/226703-php-mssql-y-acento
> s.html>
>
http://www.psicofxp.com/forums/desarrollo-web.264/226703-php-mssql-y-acentos
> .html
>
>  <http://www.bdat.net/cuestiones_php/php3/0702.html>
> http://www.bdat.net/cuestiones_php/php3/0702.html
>
>
>
<http://www.forosdelweb.com/f18/problemas-con-caracteres-especiales-acentos-
> php-mssql-server-364345/>
>
http://www.forosdelweb.com/f18/problemas-con-caracteres-especiales-acentos-p
> hp-mssql-server-364345/
>
>  <http://markmail.org/message/7rksvz44sj2te5sl>
> http://markmail.org/message/7rksvz44sj2te5sl
>
>  <http://www.phpbuilder.com/board/archive/index.php/t-10208269.html>
> http://www.phpbuilder.com/board/archive/index.php/t-10208269.html
>
>
>
>
>
> Thanks in advanced.
>
> Leticia Larrosa
>
>
> __________________________________________
>
> Participe en Universidad 2008.
> 11 al 15 de febrero del 2008.
> Palacio de las Convenciones, Ciudad de la Habana, Cuba
> http://www.universidad2008.cu

Hi Leticia,

You should be using utf-8, really.  What you're dealing with are
encoding issues.  8bit character sets just can't hold all known
characters, so people invented lots of them to make up for this.  See
my links below for an in depth look.  Maybe, just maybe, we can trick
the browser into showing your text right.  Below the header and the
meta tag are the key parts to it.

Try this:
<?php
header("Content-Type: text/html; charset=iso-8859-1");
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
i18n ftw!
</body>
</html>

You might also take a look at:
http://www.microsoft.com/sql/technologies/php/default.mspx

Also please read this: http://www.phpwact.org/php/i18n/charsets.

And this too: http://talks.php.net/show/wereldveroverend-ffm2004

Have fun!


__________ NOD32 2808 (20080120) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


__________________________________________

Participe en Universidad 2008.
11 al 15 de febrero del 2008.
Palacio de las Convenciones, Ciudad de la Habana, Cuba
http://www.universidad2008.cu
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to