A
A
AlexeyMoshkin2015-11-18 13:24:17
JavaScript
AlexeyMoshkin, 2015-11-18 13:24:17

How to fix new Notification encoding issue?

We have code:

var text = 'Оповещаю Вас о важнейшем событии'

notify = function( text ) {

      if ( requestNotificationPermissions() ) {
        var n = new Notification(
          'Оповещение!',
          { icon: 'images/image.png', body: text });

        setTimeout( n.close.bind(n), 5000 );
      }
    },

When calling a function in a notification, instead of the Russian language, krakozyabry (like win 1252)
68877acb6c.png
The problem manifested itself on windows 10 and on xubuntu 15, but not on OS X

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlexeyMoshkin, 2015-11-19
@AlexeyMoshkin

The notification was called in the background.js script, and it was included in background.html. So in the .html file it was necessary to register

<head>
    <meta charset="utf-8">
...

A
Alexander Taratin, 2015-11-18
@Taraflex

Check all extension files are saved in utf8 without BOM

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question