Questions tagged [character-set]
173 questions
22
votes
3 answers
Modify all tables in a database with a single command
Is there a single or a one line command to modify all tables within a database. I would like to issue this command in every table within a database:
ALTER TABLE `table_name` CONVERT TO CHARACTER SET utf8;
My objective is to modify the charset from…
hodl
- 321
- 1
- 2
- 6
21
votes
3 answers
How can I insert smiley faces into MySQL ( )
I'm on MySQL 5.5.21, and trying to insert the '\xF0\x9F\x98\x8A' smiley face character. But for the life of me, I can't figure out how to do it.
According to various forums which I've been reading, it is possible. But whenever I try it, the data…
Bryan Hunt
- 313
- 1
- 2
- 7
21
votes
5 answers
Why does the varchar datatype allow unicode values?
I have a table with a varchar column. It is allowing Trademark(™), copyright(©) and other Unicode characters as shown below.
Create table VarcharUnicodeCheck
(
col1 varchar(100)
)
insert into VarcharUnicodeCheck (col1) values ('MyCompany')
insert…
Shiva
- 807
- 3
- 8
- 17
17
votes
1 answer
Error starting SQL Server 2017 service. Error Code 3417
I have SQL Server 2017 installed on my computer. This is what SELECT @@VERSION returns:
Microsoft SQL Server 2017 (RTM-GDR) (KB4293803) - 14.0.2002.14 (X64) Jul 21 2018 07:47:45 Copyright (C) 2017 Microsoft Corporation Enterprise Edition…
Beginner
- 273
- 1
- 3
- 7
12
votes
1 answer
Why default character_set_server is latin1?
I am using MySQL 5.5 and when I show variables about charset, I have
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
|…
Yoga
- 549
- 3
- 8
- 15
11
votes
1 answer
Does latin1 have performance benefits over utf8?
I have a table in utf8 with > 80M records and one of the columns (char(6) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL) can contain just latin symbols ([a-zA-Z0-9]). Does it have the sense to convert this column into latin1?
MySQL doc says:
To save…
Alexey
- 288
- 4
- 14
9
votes
2 answers
Determine Oracle session client character set?
I know how the database characterset (NLS_CHARACTERSET in select * from v$nls_parameters;) and the client character set (the client environment setting NLS_LANG) interact.
What I can't find out however, is how or if I can determine, for an…
Martin
- 2,420
- 4
- 26
- 35
9
votes
2 answers
Best General Purpose Character Set and Collation for MySQL
Currently, whenever I create a new MySQL database, I use utf8mb4 as a character set and utf8mb4_unicode_520_ci for the collation, e.g.:
CREATE DATABASE IF NOT EXISTS db_name
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
Is there…
GTS Joe
- 273
- 1
- 2
- 8
8
votes
2 answers
What is the SQL Server equivalent of MySQL's utf8mb4 character set?
We have some web applications based on databases using utf8mb4 as character set and utf8mb4_Standard as collation.
We saw that we can use any character we want with this setting.
In SQL Server Express the situation is not very clear to me.
When I…
Matthias
- 181
- 1
- 1
- 4
8
votes
2 answers
Change default collation for character set utf8mb4 to utf8mb4_unicode_ci
When creating a database without specifying a character set or collation the servers defaults are used (as expected).
MariaDB [(none)]> SHOW VARIABLES LIKE '%_server' ;
+----------------------+--------------------+
| Variable_name | Value …
Peter van der Wal
- 183
- 1
- 1
- 4
8
votes
2 answers
How do I list all available encoding types available in postgreSQL?
SELECT datname, pg_encoding_to_char(encoding)
FROM pg_database;
…lists all the databases, each with its encoding type.
However, I am trying to find out what are all the encoding types available in the PostgreSQL server. Can I query for all…
Ashwin
- 183
- 1
- 5
7
votes
1 answer
Query to find rows containing ASCII characters in a given range
I am using some scripts from another topic, but the accepted answer isn't working for all my data scenarios. I would have asked my question on the original How to check for Non-Ascii Characters post, but I don't have enough reputation to comment or…
Fred
- 73
- 1
- 1
- 7
7
votes
2 answers
How to convert control characters in MySQL from latin1 to UTF-8?
While converting a database to UTF-8 I noticed a strange behavior regarding the control characters 0x80-0x9F. For example, 0x92 (right apostrophe) would not get converted to UTF-8 and truncate the rest of the content of a column, using this…
Derek Downey
- 23,568
- 11
- 79
- 104
6
votes
2 answers
MySQL silently replaces UTF chars with literal question marks
I'm experiencing a situation similar to this SO question i.e. I'm working with a legacy database which has UTF8 content in latin1 tables (pretty ugly I know).
Now I'm getting new data from a new application which is completely utf8 and works with…
Fabio
- 169
- 1
- 1
- 11
6
votes
1 answer
Setting default charset/collation for MySQL database
I have a MySQL DB that used to be latin1, and I changed all the columns in all the tables to be utf8. However, I evidently didn't do all I had to do, because I just found that I have a crazy mixture of latin and utf8. Basically, any new tables and…
Daniel Magliola