6

I'm using custom labels to display messages in a Visualforce page. The label contains an apostrophe that isn't displaying on the page. Can I get the apostrophe to display, or do I need to reword the label to take it out?

The label value is: "{0}" can't be interpreted as a true/false value. Please check the box if this field is true.

The relevant vf snippet is:

<apex:outputText value="{!$Label.Error_Invalid_Boolean}">
      <apex:param value="{!wrapper.affordableUnitInput}" />
</apex:outputText>

I've tried setting escape to false on the outputText and adding \ before the ' in the custom label. Neither of those worked.

enter image description here

6

Looks like you may just need to double up the quote in the label text.

"{0}" can''t be interpreted as a true/false value. Please check the box if this field is true.

Based on this half-related question: How to Escape Single Quotation Mark in String.format

| improve this answer | |
  • 2
    Right. Single quotes are escape delimiters that prevent {...} sequences from being interpreted as format strings. We had this problem using String.format to make CSV output. – sfdcfox Oct 31 '14 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.