Solved

how to install spanish character set?

Posted on 2008-10-12
9
783 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

816 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

10 Experts available now in Live!

Get 1:1 Help Now