Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Drupal Basics Getting Started with Drupal Setting Up a Database for Drupal

Lewis Cowles
Lewis Cowles
74,902 Points

utf8_general_ci, really?

Why does drupal recommend utf8_general_ci and not utf8mb4_general_ci, which allows for many more possible characters to be stored?

I searched the internet and came up with the following Drupal patch that has been tested at several revisions https://www.drupal.org/files/issues/2488180-60.patch. I Think if I do use Drupal, I'll use this patch, but I want to understand if there are good reasons Drupal currently does not (is it just BC?)

Not being a Drupal user per-se, I have never encountered this, but utf8 without mb4 in modern PHP MySQL was a red-flag, and I would like to know if mb4 is going to be in higher patch releases to Drupal, or even Drupal 8?

2 Answers

I asked this question in relation to the SQL course and received no response. PHP The Right Way says to use the mb4 also, so I use that whenever possible.

Lewis Cowles
Lewis Cowles
74,902 Points

Thanks Ted,

I Don't think doing anything just because Phil Sturgeon says so, is a great idea...

I would definitely hope you would be careful how much of "PHP The Right Way" you follow without deciding for an informed reason as well. It's not that it's wrong, it's just not the only guide to PHP, nor the only right way to go about using PHP.

What I'm really looking for is why Drupal chooses not to use an extended character set, if there is a good reason why not to use it, or a vulnerability with mb4 I don't know of, or if they plan to support it in the future.

I have seen nothing that indicates that there is a problem with mb4 and have not looked into Drupal and why it uses what it does.

I try not to use anything blindly, but his site is highly recommended from several different sources including here. Given those recommendations, I tend to trust what he says more than sites that I just find on Google. But as I said, I do try to figure out what is going on.