+ Start a Discussion
Lukas Razim 29Lukas Razim 29 

<apex:outputText escape="false"> special characters missing

Hi All,

I have requirement to generate letter(in paper form) for all campaign members (we use campaigns more like events, so those letters are supposed to be invitations). So I added custom button on the layout that should render the information as pdf. I also added rich text field where the text for the letter is stored. See below code:

apex:page standardController="Campaign" showHeader="false" renderAs="pdf" applyBodyTag="false">
  <apex:repeat value="{!Campaign.CampaignMembers}" var="line">
    <div style="page-break-after:always;">
  <span style="font-family: Arial Unicode MS">
  {!line.Contact.Oslovujeme__c}, <br/><br/>
    <apex:outputText value="{!Campaign.Campaign_Letter_Rich__c}" escape="false"/>
    </span>
  </div>
    </apex:repeat>
</apex:page> 

The problem is.. that we have special characters in my language, such as ř,ě,ň, etc. These characters are generated correctly on pdf only for my custom field on contact Oslovujeme__c. But if any of these characters are in Campaign_Letter_Rich__c, they are missing on pdf. I suppose it has something to do with "escape" attribute. If I dont use it characters are rendered fine but with all the code around.. Can anyone help me please?
Thank you very much
Best Answer chosen by Lukas Razim 29
ArmouryArmoury
looks like it is not an issue with escape attribute.. If you remove the renderAs="pdf" in the first line, the VF page displays all the characters correctly for both the fields.. So most likely its an issue with how SF creates the pdf.. maybe his goes as a bug to SF?

All Answers

sfdcsushilsfdcsushil
Hi, 

When you are using escape = false. Charaters are coming fine right? I am not able to get the issue/? Can you paster sample output when you are using escape = false. 
Lukas Razim 29Lukas Razim 29
Check the output if I use input "ěščřžýáíéúů" into both fields Oslovujeme__c and Campaign_Letter_Rich__c:

ěščřžýáíéúů,

šžýáíéú

Some of the characters are missing
ArmouryArmoury
looks like it is not an issue with escape attribute.. If you remove the renderAs="pdf" in the first line, the VF page displays all the characters correctly for both the fields.. So most likely its an issue with how SF creates the pdf.. maybe his goes as a bug to SF?
This was selected as the best answer