lostyazilim

utf8_general_ci ile utf8mb4_unicode_520_ci arasındaki fark ?

5 Mesajlar 1.795 Okunma
lstbozum
wmaraci reklam

silenthilll silenthilll WM Aracı Kullanıcı
  • Üyelik 29.09.2011
  • Yaş/Cinsiyet 39 / E
  • Meslek öğrenci
  • Konum Manisa
  • Ad Soyad M** K**
  • Mesajlar 699
  • Beğeniler 61 / 126
  • Ticaret 1, (%100)
utf8_general_ci ile utf8mb4_unicode_520_ci arasındaki fark var mı ?

localhost mysqlde utf8_general_ci seçiliyken hosting veri tabanında utf8mb4_unicode_520_ci seçili bunların arasında fark var mı ? hangisi seçilmeli ?

ikisi arasında veri aktarımı yapıldığında bir sorun oluşturur mu
 

 

wmaraci
reklam

BarisYILMAZ BarisYILMAZ WM Seo Tool Kullanıcı
  • Üyelik 09.04.2015
  • Yaş/Cinsiyet 41 / E
  • Meslek Bilgisayar Teknik Servis
  • Konum İstanbul Avrupa
  • Ad Soyad B** Y**
  • Mesajlar 394
  • Beğeniler 207 / 132
  • Ticaret 5, (%100)
Genelde utf8_general_ci kullanırlar.
 

 

silenthilll silenthilll WM Aracı Kullanıcı
  • Üyelik 29.09.2011
  • Yaş/Cinsiyet 39 / E
  • Meslek öğrenci
  • Konum Manisa
  • Ad Soyad M** K**
  • Mesajlar 699
  • Beğeniler 61 / 126
  • Ticaret 1, (%100)
Burada birşeyler anlatmış yeterli ingilizcem olmadığından anlamadım özetleyecek arkadaş var mı ?

https://stackoverflow.com/questions/51278467/mysql-collation-utf8mb4-unicode-ci-vs-utf8mb4-default





utf8mb4_default?? Where do you see this?

The default collation for utf8mb4 is utf8mb4_general_ci. This checks only one byte at a time, so ss is not considered equal to ß. Most of the other collations for utf8mb4 do consider them equal.

Next in the list of "better" collations for general use (as opposed to Spanish-specific, etc) is utf8mb4_unicode_ci. This matches the Unicode Collation Algorithm version 4.0, written several years ago.

Then comes utf8mb4_unicode_520_ci (Unicode 5.20), which handles more things "correctly".

When you get to MySQL 8.0, there will be a 9.0 version, utf8mb4_0900_ai_ci.

For details on the differences, see http://mysql.rjweb.org/utf8_collations.html . (Note: "utf8" versus "utf8mb4" work the same for the information provided on that page.) The first thing to note:

utf8_general_ci A=a=À=Á=Â=Ã=Ä=Å=à=á=â=ã=ä=å=Ā=ā=Ą=ą Aa ae az
utf8_unicode_ci A=a=ª=À=Á=Â=Ã=Ä=Å=à=á=â=ã=ä=å=Ā=ā=Ą=ą Aa ae az Æ=æ
utf8_unicode_520_ci A=a=ª=À=Á=Â=Ã=Ä=Å=à=á=â=ã=ä=å=Ā=ā=Ą=ą Aa ae=Æ=æ az

These 3 lines point out 3 different treatments of Æ and æ.

Those two ligatures are treated equal ("case insensitive").
general does not sort it anywhere near the other A's. (Far below, we see that they sort after Z.)
unicode sorts them after all A's, and just before B, as if they were a separate "letter".
_unicode_520_ treats them as equal to letter pair ae.

For 5.7, and without any specific language requirements, I would use utf8mb4_unicode_520_ci.

Back to your question of "why". Changing defaults runs the risk of hurting existing installations more than it helps. So, I guess, the designers were conservative. On the other hand, 8.0 has a lot of major changes, so there was less reluctance to change. Hence, the move to utf8mb4_0900_ai_ci.


 

 

Decimas Decimas WM Aracı Kullanıcı
  • Üyelik 19.04.2015
  • Yaş/Cinsiyet 26 / E
  • Meslek Developer
  • Konum İstanbul Avrupa
  • Ad Soyad E** E**
  • Mesajlar 821
  • Beğeniler 1 / 302
  • Ticaret 1, (%100)
utf8 genel karakterleri kapsar, örneğin ingiliz Alfabesi, Türk alfabesi, x alfabesi, bazı üst karakterler vs. Yani günlük haytta pekçok işimizi utf8 ile görebiliriz ancak Çince, Korece, Yunanca (kimi durumlarda, genelde geleneksel veya yeni karkterler) gibi dillerin harfleri, karakterleri ve ayrıca yüzlerce üst karakter, emoji gibi karakterler için utf8mb4 kullanılması gerek çünkü utf8 bu tip karakterleri desteklemiyor. utf8 içeriği utf8mb4'e import edebilirsin ama utf8mb4 içeriği utf8'e import edemezsin (etsen bile kutucuk vs görürsün o karakter desteklenmediği için).

Örnek vermek gerekirse bir blogta yazılan yazılar ve yorumlar için utf8 yeterli olabilir ama bir mesajlaşma uygulamasında yazan kişiler farklı diller, tuhaf karakterler kullanabilirler, emoji kullanabilirler bu yüzden utf8mb4 daha zengin bir yelpazeye hitap ediyor.

utf8mb4'ün seçili olması bir dezavantaj değil, bir gün projende ihtiyaç duyulursa zaten destekli karakter setini kullanıyor olacaksın.
silenthilll

kişi bu mesajı beğendi.

no time for caution
wmaraci
wmaraci

silenthilll silenthilll WM Aracı Kullanıcı
  • Üyelik 29.09.2011
  • Yaş/Cinsiyet 39 / E
  • Meslek öğrenci
  • Konum Manisa
  • Ad Soyad M** K**
  • Mesajlar 699
  • Beğeniler 61 / 126
  • Ticaret 1, (%100)
Teşekkür ederim.
 

 

wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al