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
sekharasekhara 

Encoding problem

Hi to all

 

I have one requirement that i have to print the data into msword from visualforce page but some special characters coming . Can any one give suggession ........

 

VF Page 

 

 

<apex:page standardController="Weekly_Reports__c" extensions="TVA_Divisional_Report" cache="true"
contentType="application/msWord" showHeader="false" StandardStylesheets="true"  > 
<html>
  <table>  <tr><!-- Used as a Column Headings And As well as retrive the required data -->
<td width = '1000px'><h3>Dealer WinsTotal : </h3><apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}</u><br/><br/>  htmlencode(<apex:outputField value="{!a.Dealer_Wins_Total__c}"/>) <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Sales Call Highlights : </h3>  <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/><br/> </u><apex:outputField value="{!a.Sales_Call_Highlights__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Dealer Wins : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}</u><br/><br/> <apex:outputField value="{!a.Dealer_Wins__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Operational Highlights : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/> </u><apex:outputField value="{!a.Operational_Highlights__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Won Opportunities/Customer Wins : </h3>  <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}<br/>  <br/></u><apex:outputField value="{!a.Won_Opportunities_Customer_Wins__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Key Initiatives : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.Key_Initiatives__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Competitive Information : </h3><apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.Competitive_Information__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>HR Information : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.HR_Information__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Warranty Management : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.Warranty_Management__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Supply : </h3><apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.Supply__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Cores/Scrap Information : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.Cores_Scrap_Information__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'> <h3>EH And S Information : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.EH_S_Information__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'><h3>Quality : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.Quality__c}"/> <br/></apex:repeat></td></tr><br/>
<tr><td width = '1000px'> <u><b>Comments/Feedback:</b></u>
<h3>Weekly Feedback : </h3> <apex:repeat value="{!searchResults}" var="a"><u>{!a.Owner.name}  <br/></u><apex:outputField value="{!a.Weekly_Feedback__c}"/> <br/></apex:repeat></td></tr>
</table> 
  </html>


</apex:page>

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

I hope using this :

 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

 

will resolve your problem. Encoding of the page is utf-8, so you must provide utf-8 encoded content. Default encoding of a page, if none specified, is iso 8859-1.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

I hope using this :

 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

 

will resolve your problem. Encoding of the page is utf-8, so you must provide utf-8 encoded content. Default encoding of a page, if none specified, is iso 8859-1.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
sekharasekhara

Thank Q very much Ankit_Arora

 

I got the solution

Ankit AroraAnkit Arora

Good to know that, it will be good if you can mark this post also as solution because it is duplicate

 

http://boards.developerforce.com/t5/General-Development/Encoding-problem/td-p/299085

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

sanjayrs23sanjayrs23

HI,

 

I am trying to print the content of richtext field data into outputtext and its showing all html tags. I am using htmlencode and escape false. is there a way i can display richtextfield data as is on outputtext, it may contain bullets, or html formatting.