Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Cliff Seal

    (@cliffseal)

    First, I’m happy to take a look at this, but please remove your low rating posted at the same time as this support request. This is the first time I’ve heard of this issue and you’ve given me literally no time to respond to it. That’s not helpful to anyone, including you.

    Now, I’m not sure why non-English characters getting oddly encoded. I’ll need some more details to actually look into this and ensure it’s actually the plugin causing this issue.

    Where are you seeing the problem? Is it inside the textarea with the embed code or somewhere else?

    Thread Starter Indell

    (@indell)

    Hi Cliff,
    Sorry about that. I will try to remove the review later today when I have time to figure out how.
    My son found what the problem was, so you don’t have to spend time looking. I will ask him to explain and get back to you.

    Plugin Author Cliff Seal

    (@cliffseal)

    Thanks! I appreciate that. I’ve seen some renewed interest in this plugin, so I’m willing to look at grouping this into a batch of changes for an update.

    Plugin Author Cliff Seal

    (@cliffseal)

    Howdy! Any update on the explanation?

    The htmlentities function takes an $encoding argument. If the argument is omitted, the function ini_get( ‘default_charset’ ) will be used to determine the encoding charset, which will cause different results depending on the PHP configuration. Simply adding the argument ‘UTF-8’ to the function call solves the problem in this case.

    $embedval = htmlentities(
    		apply_filters(
    			'infographic_embedder_image_code',
    			'<img src="' /... html link stuff .../ ',
    		), 'UTF-8'
    );

    This will only happen in some PHP versions. In PHP 5.4 and 5.5, UTF-8 is the default value for init_get( ‘default_charset’ ), so with those versions it works. Earlier versions of PHP use ISO-8859-1 as the default encoding value, and that should also work. So this problem really only occurs when using PHP 5.6 or greater.

    Thread Starter Indell

    (@indell)

    That was my sons explanation.
    Concerning the review, I have emailed [email protected] as webdevmattcrom suggested. I got a reply only containing a link to the review, nothing else. I replied asking for an explanation. Hopefully it will be deleted.

    Plugin Author Cliff Seal

    (@cliffseal)

    Got it! That explains why I hadn’t heard of this before—special characters on 5.6 when the default character encoding is not UTF-8 is what it takes to generate this issue. Makes sense, and thanks a ton for the explanation, Anton!

    To be clear: you want your default character encoding to be something other than UTF-8 on your server, but need this plugin to output UTF-8 encoded markup, correct? It would seem like the fix for most folks is to ensure default_charset is set properly, so I want to be sure I do the best thing for you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to make it work with non-English characters?’ is closed to new replies.