I have no experience in PHP but I found the following php-code for a wordpress-plugin that asks a user to say Yes or No when user clicks on the Publish-button in Wordpress.
The problem with the code below is that some characters are now shown correctly in the popup-box which appear. I think that the string-message somehow needs to be encoded with UTF8 and I really don't know how to do this or if it is even possible. This is the code:
<?php
/*
Plugin Name: Confirm publish
*/
$c_message = 'è un test?'; // your confirm message
function confirm_publish(){
global $c_message;
echo '
<script type="text/javascript"><!--
var publish = document.getElementById("publish");
if (publish !== null) publish.onclick = function(){
return confirm("'.$c_message.'");
};
// --></script>';
}
add_action('admin_footer', 'confirm_publish');
?>
If it is possible, can someone please let me know what I need to look for or what I need to do with above code to make it work?