Freemarker - lack of special character in email subject template cause email content crash
Posted
by
freakman
on Stack Overflow
See other posts from Stack Overflow
or by freakman
Published on 2012-11-07T12:01:32Z
Indexed on
2012/11/12
11:01 UTC
Read the original article
Hit count: 365
im fighting with strange error. Im using seperate freemarker templates for mail subject and body. It is sent using org.springframework.mail.javamail.JavaMailSender. Only templates that contains some special swedish character works in my application ( yes you read right... not the other way). If I delete it my email content crashes. It contains then:
MIME-Version: 1.0
Content-Type: text/html;charset=UTF-8
Content-Transfer-Encoding: 7bit
..
html code here
..
My freemarker.properties file
locale=sv_SE
classic_compatible=false
number_format=
date_format=yyyy-MM-dd
time_format=HH:mm
datetime_format=yyyy-MM-dd HH:mm
output_encoding=UTF-8
url_escaping_charset=UTF-8
auto_import=spring.ftl as spring
auto_include=
default_encoding=UTF-8
localized_lookup=true
strict_syntax=true
whitespace_stripping=true
template_update_delay=10
Ive tried to convert subject file with dos2unix tool. Using 'find -bi subject.ftl' show that encoding is us-ascii. With added special character - utf-8.
This thing is suprisingly strange for me...
//SOLUTION:
use :set bomb
and save file in vim.
© Stack Overflow or respective owner