WordPress.org

Make WordPress Core

Changeset 37523


Ignore:
Timestamp:
05/23/2016 06:31:44 AM (3 years ago)
Author:
pento
Message:

Database: Use the utf8mb4_unicode_520_ci collation, when available.

The utf8mb4_unicode_520_ci (Unicode Collation Algorithm 5.2.0, October 2010) collation is an improvement over utf8mb4_unicode_ci (UCA 4.0.0, November 2003).

There is no word on when MySQL will support later UCAs.

Fixes #32105.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r37521 r37523  
    765765                $this->collate = str_replace( 'utf8_', 'utf8mb4_', $this->collate );
    766766            }
     767        }
     768
     769        // _unicode_520_ is a better collation, we should use that when it's available.
     770        if ( $this->has_cap( 'utf8mb4_520' ) && 'utf8mb4_unicode_ci' === $this->collate ) {
     771            $this->collate = 'utf8mb4_unicode_520_ci';
    767772        }
    768773    }
     
    31943199     * @since 2.7.0
    31953200     * @since 4.1.0 Support was added for the 'utf8mb4' feature.
     3201     * @since 4.6.0 Support was added for the 'utf8mb4_520' feature.
    31963202     *
    31973203     * @see wpdb::db_version()
     
    32323238                    return version_compare( $client_version, '5.5.3', '>=' );
    32333239                }
     3240            case 'utf8mb4_520' :  // @since 4.6.0
     3241                return version_compare( $version, '5.6', '>=' );
    32343242        }
    32353243
Note: See TracChangeset for help on using the changeset viewer.