function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

hyphen replaced by –

I have an apex trigger that creates a text file on input of a PDF file.  It works fine except for one bit.



textbody = 'CODEPAGE:819'+' \r '+ 'COMMENT: Begin Prolog'+' \r '+ 'COMMENT: Customer Identifier – GFF'+' \r '+


Creates a textbody of 


 COMMENT: Begin Prolog
 COMMENT: Customer Identifier â€" GFF 


As you can see.  '-' is producing a value of  –.  Search as I might on the forums, I can't find any reference to how to declare a Hyphen in a Textbody Call.  




Best Answer chosen by Admin (Salesforce Developers) 

Got it.





'COMMENT: Customer Identifier - GFF'+' \r '+



'COMMENT: Customer Identifier '+'-'+' GFF'+' \r '+

 Addressed the issue (though I'm not savvy enough to say why.  The spaces apparently get read by the Textbody method logic in a funny way.