?
Solved

how to install spanish character set?

Posted on 2008-10-12
9
Medium Priority
?
824 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
7 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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month16 days, 12 hours left to enroll

862 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