Advertisement

02.07.2008 at 06:49PM PST, ID: 23146757
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

MySql data conversion from latin1 to utf8

Tags: MySql, SQL, UTF8, database, utf8, encoding
I am trying to convert my MySql 5.0.* application data from latin1 to UTF8.  In doing so, my European words with special characters are getting truncated upon uploading.

My database settings were originally:
character_set_client    latin1
character_set_connection        latin1
character_set_database  latin1
character_set_filesystem        binary
character_set_results  latin1
character_set_server    latin1
character_set_system    utf8
character_sets_dir      /usr/share/mysql/charsets/
Variable_name  Value
collation_connection    latin1_swedish_ci
collation_database      latin1_swedish_ci
collation_server        latin1_swedish_ci


Based on database config file changes, they are now:
character_set_client    utf8
character_set_connection        utf8
character_set_database  utf8
character_set_filesystem        binary
character_set_results  utf8
character_set_server    utf8
character_set_system    utf8
character_sets_dir      C:\\apps\\mysql\\share\\charsets\\
Variable_name  Value
collation_connection    utf8_general_ci
collation_database      utf8_general_ci
collation_server        utf8_unicode_ci

This seems correct.

My code does the following:
mysqldump ${DATABASE} ${ID} ${PASSWORD} --default-character-set=latin1 |
            sed -e "s/DEFAULT CHARSET=latin1/DEFAULT CHARSET=utf8/g" | \
            sed -e "s/SET NAMES latin1/SET NAMES utf8/g"  > datafile

I drop the old database and recreated it as UTF8.

Then I do:
cat datafile | mysql --default-character-set=utf8 ${ID} ${PASSWORD} ${DATABASE}

Once this is done the data after special characters in fields is truncated in the new database.  datafile holds data that looks like it still has the special characters.

Ideas on what I am doing wrong?

Thanks!


Start your free trial to view this solution
Question Stats
Zone: Database
Question Asked By: johnike
Solution Provided By: TomasHelgi
Participating Experts: 2
Solution Grade: A
Views: 62
Translate:
Loading Advertisement...
02.08.2008 at 02:47AM PST, ID: 20849064

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.08.2008 at 05:17AM PST, ID: 20849768

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.08.2008 at 09:39PM PST, ID: 20856342

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.09.2008 at 02:04AM PST, ID: 20856787

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.09.2008 at 02:05AM PST, ID: 20856789

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.11.2008 at 08:05AM PST, ID: 20867414

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628