Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8813537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:52:44+00:00 2026-06-14T03:52:44+00:00

im fighting with strange error. Im using seperate freemarker templates for mail subject and

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:52:45+00:00Added an answer on June 14, 2026 at 3:52 am

    As per request of @freakman, I post my comment as an answer – as it turned out to solve the problem:

    Append the BOM (Byte Order Mark) to the beginning of the template file, to ensure it is always parsed as an UTF-8 template.

    For reference, the BOM for UTF-8 is:

    • Hexadecimal: EF BB BF
    • ISO-8859-1 encoded 
    • Java: byte[] bom = { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm fighting with a strange problem using the spring security core plugin. after a
I am fighting with a very strange javascript behavior on a jQuery UI widget
Still fighting with templates. In this example, despite the fact that is copied straight
I have been fighting with this error for a while. The error is somewhere
There is this strange situation I'm fighting on. I have 3 pages, les call
I'm fighting with a strange behavior here... Doing an asp.net mvc3 application with NHibernate
I'm fighting this error and i can't find a way of fixing it... Take
I'm fighting with a very strange behaviour in my Android app. I have a
I'm fighting with this strange problem, where recvfrom returns only when it catches broadcast
I'm fighting with this database and i have a strange problem... If I try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.