Arabic is displayed as ????? in velocity template

Greetings all i am using velocity templates in sending emails and in the template i have some arabic texts

and when sending the email, the text appears like ?????????? i don't know why:

encoding is set to utf-8 before sending the email here:

VelocityEngineUtils.mergeTemplateIntoString(velocityEngine,templateName, "UTF-8",newModel);

i tried to add the charset in the vm, but with no luck:

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

any ideas why such problem occurs ?

Answers


I was able to produce Arabic text (تجاوز سعة مكدس) on a plain-text email sent from a Spring app. The text displayed properly on GMail as well as Thunderbird. Here's my mail sending logic:

public void send(String fromAddress, String fromName,
    String toAddress, String subject,
    String template, Map<String, Object> model) {
  MimeMessagePreparator preparator = new MimeMessagePreparator() {
    public void prepare(MimeMessage mimeMessage) throws Exception {
      MimeMessageHelper message = new MimeMessageHelper(
          mimeMessage, "UTF-8");
      message.setTo(toAddress);
      message.setFrom(new InternetAddress(fromAddress, fromName));
      message.setSubject(subject);
      message.setText(VelocityEngineUtils
          .mergeTemplateIntoString(velocityEngine, template, "UTF-8", 
              model));
    }
  };
  mailSender.send(preparator);
}

Need Your Help

Using new sse registers xmm8 - xmm15

x86 64bit assembly sse cpu-registers

My question is short. Is it possible to use new sse registers from Visual Studio 2010 inline assembler? If so, how and what else conditions must be satisfied? I don't know for example if new regist...

Folder Organization for C# Layout Website

c# folder

It might be a simple thing for you but I just started (1 week ago) to program with Sharp C# / Razor for my intranet web site. So I was able to learn a lot of things in the last week.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.