wp_set_internal_encoding

Set internal encoding.

Description

wp_set_internal_encoding(); 

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.


Usage

  1. if ( !function_exists( 'wp_set_internal_encoding' ) ) { 
  2. require_once ABSPATH . WPINC . '/load.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_set_internal_encoding(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/load.php  
  1. function wp_set_internal_encoding() { 
  2. if ( function_exists( 'mb_internal_encoding' ) ) { 
  3. $charset = get_option( 'blog_charset' ); 
  4. if ( ! $charset || ! @mb_internal_encoding( $charset ) ) 
  5. mb_internal_encoding( 'UTF-8' );