Solved

how to install spanish character set?

Posted on 2008-10-12
9
785 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

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…
Creating and Managing Databases with phpMyAdmin in cPanel.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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