Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

wp_set_internal_encoding() WordPress Function

The wp_set_internal_encoding() function sets the internal encoding for WordPress. This function is useful for sites that want to change their internal encoding, but it should be used sparingly as it may cause compatibility issues.

wp_set_internal_encoding() #

Set internal encoding.


Description

In most cases the default internal encoding is latin1, which is of no use, since we want to use the mb_ functions for utf-8 strings.


Top ↑

Source

File: wp-includes/load.php

function wp_set_internal_encoding() {
	if ( function_exists( 'mb_internal_encoding' ) ) {
		$charset = get_option( 'blog_charset' );
		// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
		if ( ! $charset || ! @mb_internal_encoding( $charset ) ) {
			mb_internal_encoding( 'UTF-8' );
		}
	}
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.