0

for example, I create .gsp page:

<html>
<head>
<g:javascript>
alert("Текст сообщения")
</g:javascript>
</head>
<body>
</body>
</html>

and write some text in cyrillic - all work fine, rezult: alert window "Текст сообщения", but, when i create gsp page:

<html>
<head>
<link rel="stylesheet" href="${resource(dir:'js/resources/css',file:'ext-all.css')}" />
<g:javascript src="test.js"></g:javascript>
</head>
<body>
</body>
</html>

and connect to the page test.js file:

alert("Тестовое сообщение");

i have a problem, result: alert window with text: "???????"

I think the problem is that the Grails does not properly handle character encoding External js file.

What should I do? please help

1
  • I do this: in my IDE STS -> Window -> Preferences -> General -> Workspace -> text file encoding -> change cp1251 on UTF-8. :) Commented Nov 24, 2010 at 9:28

1 Answer 1

2

have you tried setting the charset attribute to

<g:javascript src="test.js" charset="UTF-8"></g:javascript>

(and/or changing whatever the encoding in your file is)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.