[SalesForce] Regarding Arrows(‘ ▼’,’ ▲’) in Visualforce Page

In the above statement I used Up & Down arrows symbols directly in Visualforce page.But when moving this code through packages from one sandbox to another sandbox then it is showing as '?' instead of showing ' ▼',' ▲'. Please suggest me anything need to write or any html ASCII codes and how to use them in VF pages..

<apex:PageBlockTable value="{!TrancheNotes}" var="a" rowClasses="odd,even" id="b2"> 
     <apex:column style="vertical-align:top;" > 
          <apex:facet name="header"> 
               <apex:commandLink value="Opportunity Name {!IF(sortfield=='Opportunity__r.name',IF(sortDir='desc',' ▼',' ▲' ),'')}" action="{!toggleSort}" > 
                    <apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
               </apex:commandLink>
          </apex:facet> 

most specifically:

value="Opportunity Name {!IF(sortfield=='Opportunity__r.name',IF(sortDir='desc',' ▼',' ▲' ),'')}"

Best Answer

The symbols you are after are the unicode arrows:

▲ = U+25B2 
▼ = U+25BC

In HTML you can use

&#x25B2;

and

&#x25BC;

instead of "pasting" the unicode character straight into your file.

The arrows work (both pasted, and as codes) in my Visualforce test page, the Salesforce Replication Architecture used in Changeset promotion encodes everything to UTF8, which does not support the raw character you can hold in your file, and it is lost in translation.

As there is also a problem setting ASCII codes in the Visualforce attribute value, I would recommend, if you are pushed for time, taking the rendering and logic out of the value and onto the page, with three different combinations of your commandlink set to render at different times using the rendered tag. Sticking this in (or a minor variation thereon) where your single current command link lives, and it should work?

<apex:commandLink action="{!toggleSort}" rendered="{!sortfield=='Opportunity__r.name' && sortDir='desc'}">
Opportunity Name &#x25B2;
<apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
</apex:commandLink>

<apex:commandLink action="{!toggleSort}" rendered="{!sortfield=='Opportunity__r.name' && sortDir!='desc'}"> 
Opportunity Name &#x25BC;
<apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
</apex:commandLink>

<apex:commandLink action="{!toggleSort}" rendered="{!sortfield!='Opportunity__r.name'}"> 
Opportunity Name
<apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
</apex:commandLink>
Related Topic