@dainius,
Having done a little reading about this it seems to be because š is not available in a plain text character set so it cannot be replaced.
Lithuanian (and some others) alphabet has such „abnormal“ characters: ąčęėįšųūž. Every character present in utf8. And only Š letter causes „problems“ in some WYSIWYG editors – it is converted to HTML entity.
I fixed this problem at you plugin code by adding line at class-s2-core.php:252
:
$message = str_replace( array('š','Š'), array('š','Š'), $message);
But still not tested.
I know, I will loose this on next plugin update. So it would be kind if you add this fix in your future update (maybe another – more „correct“ place in code).
As I mentioned, this problem appears to many users, because this character is „popular“ not only in one language.
Also you delete a lot of potential characters by
$message = preg_replace('|&[^a][^m][^p].{0,3};|', '', $message);
Why not to decode them back using html_entity_decode()
?
This could be safe, because here we talk about converting from HTML to plain-text mail.
I think instead of doing:
$message = preg_replace('|&[^a][^m][^p].{0,3};|', '', $message);
$message = preg_replace('|&|', '&', $message);
it would be better to do:
$message = html_entity_decode( $message, ENT_NOQUOTES, 'UTF-8' );
BTW this also will fix Š
problems 🙂
@dainius,
Those preg_replace() calls are pretty old code now and I think your approach is simpler and better. I’ll get your change rolled into the next version.