Background of the issue:
I am trying to translate product titles and descriptions using WPML, while keeping special characters like the en dash (–) unchanged. You can see the issue on this page: hidden link.
Symptoms:
The en dash (–, Unicode U+2013) is automatically replaced by a regular hyphen (-, ASCII 0x2D) in the translated content, which alters the intended formatting.
Questions:
How can I prevent WPML from altering specific characters like the en dash during translation?
1- Get access to your website files.
2- Go to \WPML_Super_Globals_Validation::get_value in wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/class-wpml-super-globals-validation.php
3- change the following code:
Hi,
Thank you for your reply and for providing the suggested code modification.
Unfortunately, after applying the change as instructed, the issue still persists: the en dash character (–) is still being replaced by a regular hyphen (-) in the translated content.
Could you please advise on the next steps or provide an alternative solution to ensure that the en dash (–, Unicode U+2013) is preserved exactly as in the source text during translation?
I can provide additional examples or screenshots if needed.
Best regards,