Solved

how to install spanish character set?

Posted on 2008-10-12
9
774 Views
Last Modified: 2012-05-05
Ho do i install spanish character set.
I tried:

Best support for Multilingualism, but it cannot handle inserts like the following word:

Zuñiga

that is a spanish word!
0
Comment
Question by:robballi
  • 4
  • 3
9 Comments
 
LVL 29

Expert Comment

by:fibo
ID: 22707514
short answer: put everything in UTF-8
- your php scripts
- your html code
- your data in MySQL

More info:
- you cannot solve the problem just at MySQL level, you must handle it also at input time and display time
- any variation along the chain of process will result in weird displays
0
 

Author Comment

by:robballi
ID: 22708019
fibo:

Could you give more specifics of how to do what you are saying?
Thanks a lot!
0
 
LVL 29

Expert Comment

by:fibo
ID: 22708970
There are few good complete yet easy to understand tutorials on this subjects.

I would suggest that you read
http://www.sitepoint.com/article/guide-web-character-encoding/
http://www.sitepoint.com/blogs/2006/03/15/do-you-know-your-character-encodings/ (print this one, you need to read back and forth!)

Also go to http://www.phparch.com/c/magazine/issue/54 register and download this issue of PHP|Architect: the article from Delahunt on this subject is really remarkable and will help you to see how all things should be put in place (doing it being more diffcult though)

In handling a project of this type (eg, see http://www.mae.u-paris10.fr/limc-france/ ) some years ago, I relied heavily on 2 tools:
- Editor: I was using the commercial UltraEdit ($50) to handle securely UTF8 and conversions between ASCII and UTF8. I would guess that the open-source Notepad++ gives today similar facilities.
- PHP IDE: I had tested at this time Zend Studio and phpEd from Nusphere. The second was NOT able AT THAT time to handle real UTF8, ie mixing accented characters (Spanish, French..) with Greek or Russin characters, while Zend Studio could do it
- MySQL: 4.1 was not yet available, I was however able to proceed with some pragmatic approach, storing string "as is" (or almost) into MySQL, and displaying the results in PhpMyAdmin... whether within phpmyadmin or with my php programs, in some cases I had to test/debug in changinfg the character set codepage of the display.. but my problems came from the fact that the initial data that was transferred from Access to MySQL.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:robballi
ID: 22726856
Dear fibo:

thanks a lot for your help.
But what specifics could i do to solve the problem.
It is something wrong with mysql, since:

for instance a typical spanish last name is: Zuñiga
by default querying that data one gets through php:       
Zu¤iga

and putting mysql_query( 'set names utf8' ) one gets the same:
Zu¤iga

i tried with ultraedit to convert it the sql inserts from asci to utf8 but nothing good resulted too.

I have to tell you that i have a third party mysql db driver that connects to mysql, but now i get:

Zu¤iga

The funny thing is if you query throuhg the command line one gets: Zuñiga.
this is through a windows application!!!

What one has to do so mysql?

I have mysql version:
5.0.51a'community-nt
0
 
LVL 29

Accepted Solution

by:
fibo earned 500 total points
ID: 22726924
1 - Read the file with php.
2 - For those fields with the problem, display them as a debugging exploration with 3 different encodings.

ie read from MySQl into $my_text
...
echo '*** checking the strings decode [' . utf8_decode($my_text) . "] ** normal [$my_text] ** encode [".
          utf8_encode($my_text) . '] ***';

Does any of the string display correctly? If so, at least you know which one helps you to display correctly what was entered in the database. You just have to change accordingly.

NOTE: during this exploration phase, it is very common to err on either side at any of the steps...
0
 

Author Comment

by:robballi
ID: 22981505
No real solution was given.
Just comments.
0
 
LVL 29

Expert Comment

by:fibo
ID: 22992088
Hi Robballi,

What was the result of trying the last code snippet I suggested?
Did you get back in your display any "normal-looking" display?
What was then the codepage of your browser?
Which other attempts did you make and what was their result?

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now