I'm using the translation workbench to translate a custom label(mail's body) to English. In the message, there was a word "haven't". When I check the test email, the word showed up as "havent".
I tried using
String.escapeSingleQuotes(mailBodyMessage) but it didn't work.
So I went to debug log and check the message retrieved from the custom label. It came out that the message I retrieved from the custom label also didn't have any single quotation marks either.
I tried changing my custom label to "haven\'t" (it showed up as haven\t) and "haven
't" (it showed up as haven
't) but nothing worked.
For now, I deleted all single quotes from my custom label but I still want to know how to fix this problem. Could someone tell me how to escape the quotation mark in custom label? Any help will be much appreciated!
I used the code that @Ralph provided and confirmed that there is nothing wrong with custom label. Single quotes disappeared after I formatted the message with String.format(). I googled and found the solution here.
To get a single quote in the output of a string.format requires two escaped single quotes.
So I put
haven''t in the custom label and now I got the correct formatted message.
Ralph, Thank you so much for your time. :)