473,507 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing UTF-8: does BLOB really work?

Hello.

I'm trying to store UTF-8 texts into a mySQL database. These
texts contains Spanish special characters.

If I set field as VARCHAR and browse stored data, I get 'año'
instead of 'año'.

But if I set field as BLOB, and I perform
SELECT * FROM my_table WHERE my_field LIKE '%año%'
it does not work.

And
SELECT * FROM my_table WHERE my_field LIKE '%año%'
does work.

I would like to be able to work with right words... is it
possible?

Thank you very much.
Jul 19 '05 #1
6 5959
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Hello.

I'm trying to store UTF-8 texts into a mySQL database. These
texts contains Spanish special characters.

If I set field as VARCHAR and browse stored data, I get 'año'
instead of 'año'.

But if I set field as BLOB, and I perform
SELECT * FROM my_table WHERE my_field LIKE '%año%'
it does not work.

And
SELECT * FROM my_table WHERE my_field LIKE '%año%'
does work.

I would like to be able to work with right words... is it
possible?

Thank you very much.


Try NVARCHAR.
Jul 19 '05 #2
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Hello.

I'm trying to store UTF-8 texts into a mySQL database. These
texts contains Spanish special characters.

If I set field as VARCHAR and browse stored data, I get 'año'
instead of 'año'.

But if I set field as BLOB, and I perform
SELECT * FROM my_table WHERE my_field LIKE '%año%'
it does not work.

And
SELECT * FROM my_table WHERE my_field LIKE '%año%'
does work.

I would like to be able to work with right words... is it
possible?

Thank you very much.


Try NVARCHAR.
Jul 19 '05 #3
Thank you very much for your answer.

Is NVARCHAR supported? I tried with:
mysql> ALTER TABLE `my_table` CHANGE `my_field` `my_field` NVARCHAR(
100 ) NOT NULL
and I get this error message:
ERROR 1064: You have an error in your SQL syntax near 'NVARCHAR( 100
) NOT NULL ' at line 1

Thanks.

"Pack Fan" <pa**@fan.com> wrote in message news:<vs************@corp.supernews.com>...
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Hello.

I'm trying to store UTF-8 texts into a mySQL database. These
texts contains Spanish special characters.

If I set field as VARCHAR and browse stored data, I get 'año'
instead of 'año'.

But if I set field as BLOB, and I perform
SELECT * FROM my_table WHERE my_field LIKE '%año%'
it does not work.

And
SELECT * FROM my_table WHERE my_field LIKE '%año%'
does work.

I would like to be able to work with right words... is it
possible?

Thank you very much.


Try NVARCHAR.

Jul 19 '05 #4
Thank you very much for your answer.

Is NVARCHAR supported? I tried with:
mysql> ALTER TABLE `my_table` CHANGE `my_field` `my_field` NVARCHAR(
100 ) NOT NULL
and I get this error message:
ERROR 1064: You have an error in your SQL syntax near 'NVARCHAR( 100
) NOT NULL ' at line 1

Thanks.

"Pack Fan" <pa**@fan.com> wrote in message news:<vs************@corp.supernews.com>...
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Hello.

I'm trying to store UTF-8 texts into a mySQL database. These
texts contains Spanish special characters.

If I set field as VARCHAR and browse stored data, I get 'año'
instead of 'año'.

But if I set field as BLOB, and I perform
SELECT * FROM my_table WHERE my_field LIKE '%año%'
it does not work.

And
SELECT * FROM my_table WHERE my_field LIKE '%año%'
does work.

I would like to be able to work with right words... is it
possible?

Thank you very much.


Try NVARCHAR.

Jul 19 '05 #5
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Thank you very much for your answer.

Is NVARCHAR supported? I tried with:
mysql> ALTER TABLE `my_table` CHANGE `my_field` `my_field` NVARCHAR(
100 ) NOT NULL
and I get this error message:
ERROR 1064: You have an error in your SQL syntax near 'NVARCHAR( 100
) NOT NULL ' at line 1

Thanks.

"Pack Fan" <pa**@fan.com> wrote in message

news:<vs************@corp.supernews.com>...
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Hello.

I'm trying to store UTF-8 texts into a mySQL database. These
texts contains Spanish special characters.

If I set field as VARCHAR and browse stored data, I get 'año'
instead of 'año'.

But if I set field as BLOB, and I perform
SELECT * FROM my_table WHERE my_field LIKE '%año%'
it does not work.

And
SELECT * FROM my_table WHERE my_field LIKE '%año%'
does work.

I would like to be able to work with right words... is it
possible?

Thank you very much.


Try NVARCHAR.


My mistake. I was thinking MSSQL. Sorry.

This might help, though: http://www.mysql.com/doc/en/Charset-Unicode.html
Jul 19 '05 #6
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Thank you very much for your answer.

Is NVARCHAR supported? I tried with:
mysql> ALTER TABLE `my_table` CHANGE `my_field` `my_field` NVARCHAR(
100 ) NOT NULL
and I get this error message:
ERROR 1064: You have an error in your SQL syntax near 'NVARCHAR( 100
) NOT NULL ' at line 1

Thanks.

"Pack Fan" <pa**@fan.com> wrote in message

news:<vs************@corp.supernews.com>...
"Francesco Moi" <fr**********@europe.com> wrote in message
news:5b**************************@posting.google.c om...
Hello.

I'm trying to store UTF-8 texts into a mySQL database. These
texts contains Spanish special characters.

If I set field as VARCHAR and browse stored data, I get 'año'
instead of 'año'.

But if I set field as BLOB, and I perform
SELECT * FROM my_table WHERE my_field LIKE '%año%'
it does not work.

And
SELECT * FROM my_table WHERE my_field LIKE '%año%'
does work.

I would like to be able to work with right words... is it
possible?

Thank you very much.


Try NVARCHAR.


My mistake. I was thinking MSSQL. Sorry.

This might help, though: http://www.mysql.com/doc/en/Charset-Unicode.html
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
11454
by: Rolf Hemmerling | last post by:
Hello ! Beginner's question: What ist the easiest way to store and save objects in a file generated by a C++ program, by using the "standard C++ library" and/or "Standard Template Library (...
14
3339
by: Ger | last post by:
Hi all. Atm i am writing special system to store and restore information. There were diffirent ideas how to do this, all have pluses and minuses. Finally we desided to write system, what is...
4
15256
by: CJ Butcher | last post by:
Hi, I have a need to pull information from an Oracle 9.2.1 database. It is storing UTF-8 characters in a varchar2(33) field. I need to be able to pull these values out and put them in a SQL...
38
5695
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I...
13
13884
by: mike_dba | last post by:
I am having some data reject on an insert of Japanese characters to a Varchar column in my DB2 UTF-8 database. I am trying to understand how big to make the Varchar column for the inesert to work...
6
13875
by: archana | last post by:
Hi all, can someone tell me difference between unicode and utf 8 or utf 18 and which one is supporting more character set. whic i should use to support character ucs-2. I want to use ucs-2...
1
1597
by: steelghost | last post by:
I'm currently trying to store images into my DB. But the collation used on my DB is big5, since my client wants this default encoding on their webpage. So to be able read the retreived data I have...
0
1421
by: nass | last post by:
hello everyone and happy new year. i am not sure how to tackle this problem or where is originates from so i am writing here in hope that if you can not help you can at least point me in a...
4
5106
by: pushpinderbagga | last post by:
hi I need help in storing and retreiving hindi text from myql... I have done the folowwing ... mysql_query("SET NAMES 'utf8'"); <META http-equiv=Content-Type content="text/html;...
11
10084
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.