Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-883

Unwanted character appear when encoding special character

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Spring 4, Velocity 1.7

      Description

      I want generate text containing temperature so I try the following command:

      #if ($unit.matches(".*Celsius"))\
      °\
      #end#**# $unit \

      but I get the following output: °

      the charater  is always displayed Regardless of the method used.

      Velocity config:

        <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
              <property name="resourceLoaderPath" value="/WEB-INF/velocity/"/>
              <property name="velocityProperties">
                  <value>
                      resource.loader=class
                   class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
                      RuntimeConstants.UBERSPECT_CLASSNAME=LinkingUberspector.class.getCanonicalName()
                      LinkingUberspector.UBERSPECT_ARRAY_CLASSNAMES,UberspectImpl.class.getCanonicalName()
                      input.encoding, UTF-8
                      output.encoding, UTF-8
                  </value>
              </property>
          </bean>
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Equ1nox julien richard
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: