I've got a bbcode wordpress plugin for wordpress.

But for whatever reason, basically publish something similar to

[i]v497212he2x2MfMi[/i] the "X" character is outputted as ×, that is another kind of X. How do i fix this?

Wordpress plugin code is below:

    class BBCode { 

    // Plugin initialization 
    function BBCode() { 
        // This version only supports WP 2.5+ (learn to upgrade please!) 
        if ( !function_exists('add_shortcode') ) return; 

        // Register the shortcodes 
        add_shortcode( 'b' , array(&$this, 'shortcode_bold') ); 
        add_shortcode( 'i' , array(&$this, 'shortcode_italics') ); 
    } 


    // No-name attribute fixing 
    function attributefix( $atts = array() ) { 
        if ( empty($atts[0]) ) return $atts; 

        if ( 0 !== preg_match( '#=("|\')(.*?)("|\')#', $atts[0], $match ) ) 
            $atts[0] = $match[2]; 

        return $atts; 
    } 


    // Bold shortcode 
    function shortcode_bold( $atts = array(), $content = NULL ) { 
        if ( NULL === $content ) return ''; 

        return '<strong>' . do_shortcode( $content ) . '</strong>'; 
    } 


    // Italics shortcode 
    function shortcode_italics( $atts = array(), $content = NULL ) { 
        if ( NULL === $content ) return ''; 

        return '<em>' . do_shortcode( $content ) . '</em>'; 
    } 

} 

// Start this plugin once all other plugins are fully loaded 
add_action( 'plugins_loaded', create_function( '', 'global $BBCode; $BBCode = new BBCode();' ) );

This modification is happening due to Wordpress's wptexturize() function that returns given text with changes of quotes to wise quotes, apostrophes, dashes, ellipses, the trademark symbol, and also the multiplication symbol.

This really is from Wordpress 3.2.1 wordpress-includes/formatting.php line 55:

$dynamic_characters = array('/\'(\d\d(?:&#8217;|\')?s)/', '/\'(\d)/', '/(\s|\A|[([{<]|")\'/', '/(\d)"/', '/(\d)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/');
$dynamic_replacements = array('&#8217;$1','&#8217;$1', '$1&#8216;', '$1&#8243;', '$1&#8242;', '$1&#8217;$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '&#8217;$1', '$1&#215;$2');

The final regex for the reason that $dynamic_characters array may be the one turning the "X" into ×

As mentioned around the function page for wptexturize... "[t]ext enclosed in the tags <pre>, <code>, <kbd>, <style>, <script>, <tt>, and [code] will be skipped.", you are able to fix this by putting that bbcode in a single of individuals tags, or make use of a wordpress plugin that may disable wptexturize, for example InScript or Disabler or Disable wptexturize.