0

I'm experiencing a strange charset encoding behavior in when developing with playframework (1.2.4). In my main.html template viewfile (other views extend from that one) I've set a

<meta charset="utf-8">

But that encoding is somehow not inherited in my other views that are embeded into main.html. Do I really have to set the at the beginning of every viewfile and partial?

I am using eclipse Indigo Service Release 1 and my default encoding for html is set to utf-8. Anyone knows what to do?

THX in advance tschundeee :)

Bijan
  • 25,559
  • 8
  • 79
  • 71

2 Answers2

1

I am using the following in my main.html which gets inherited by all my templates:

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

Are you using a front end http server? If so you might want to check that the response headers are not being modified.

emt14
  • 4,846
  • 7
  • 37
  • 58
  • I also thought that setting the charset once in the main.html template would be enough... Unfortunately this is not inherited in the subtemplates. I am using "play run" for development... – Bijan Jan 02 '12 at 20:20
0

Read this: https://stackoverflow.com/a/6080299/425491
Shortly, save html file with Notepad++ in encoding "UTF-8 without BOM" and your problem should be fixed. Also Eclipse as far as i know can't save files in this encoding.

Community
  • 1
  • 1
Ilia Akhmadullin
  • 1,573
  • 1
  • 10
  • 16
  • I'm on OSX and there is no Notepad++ available. And I also don't want to open every file I create in Eclipse in a separate editor save it and then reopen it in eclipse... This is really strange... – Bijan Jan 02 '12 at 20:23