• Resolved moggiex

    (@moggiex)


    Warning: mb_convert_encoding() [function.mb-convert-encoding]: Illegal character encoding specified

    If you’re receiving this error on lines 323 and 334, its caused by the encoding ‘auto’ function not working, change the ‘auto’ to ‘ISO-8859-1’ and it’ll function correctly.

    So from Line 320 to line 337, this is athe amended code:

    $returnval .= '						<tr>'."\n";
    					$returnval .= '							<td class="amazon-new-label">'.$appip_text_newfrom.':</td>'."\n";
    					if($result["TotalNew"]>0){
    						$returnval .= '							<td class="amazon-new">'. mb_convert_encoding($newPrice , $encodemode, mb_detect_encoding( $newPrice, "ISO-8859-1" )).' <span class="instock">'.$appip_text_instock.'</span></td>'."\n";
    					}else{
    						$returnval .= '							<td class="amazon-new">'. mb_convert_encoding($newPrice , $encodemode, mb_detect_encoding( $newPrice, "auto" )).' <span class="outofstock">'.$appip_text_outofstock.'</span></td>'."\n";
    					}
    					$returnval .= '						</tr>'."\n";
    				}
    				if(isset($result["LowestUsedPrice"])){
    					$returnval .= '						<tr>'."\n";
    					$returnval .= '							<td class="amazon-used-label">'.$appip_text_usedfrom.':</td>'."\n";
    					if($result["TotalUsed"]>0){
    
    						$returnval .= '						<td class="amazon-used">'. mb_convert_encoding($result["LowestUsedPrice"], $encodemode, mb_detect_encoding( $result["LowestUsedPrice"], "ISO-8859-1" )) .' <span class="instock">'.$appip_text_instock.'</span></td>'."\n";
    					}else{
    						$returnval .= '						<td class="amazon-new">'. mb_convert_encoding($result["LowestNewPrice"], $encodemode, mb_detect_encoding( $result["LowestUsedPrice"], "auto" )) . ' <span class="outofstock">'.$appip_text_outofstock.'</span></td>'."\n";
    					}

    Matt

    http://wordpress.org/extend/plugins/amazon-product-in-a-post-plugin/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks for pointing that out moggiex. I’ll work some change into my next upgrade.
    More accurately, it should probably be ‘ISO-8859-1,ASCII,UTF-8’ instead of just ISO-8859-1, just because in other locals, the API may return the string data in a different encoding mode. In your case, ISO-8859-1 works fine, but it may not always be the case.
    – Don Fischer

    Thread Starter moggiex

    (@moggiex)

    Hi Don,

    Good point, updated them 🙂

    Many thanks,

    Matt

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Amazon Product In a Post Plugin] [Resolved] Warning: mb_convert_encoding() [function.mb-con’ is closed to new replies.