D
D
Deodatuss2015-06-09 12:31:43
JavaScript
Deodatuss, 2015-06-09 12:31:43

How to solve cyrillic problem in angular?

In general, there is a form that is responsible for entering and registering. If the login and password are not correct, then angular displays an error in the scope. But the problem is that the error needs to be displayed in Ukrainian and the browser displays it like this:
a1e24c9b1e.jpg
This is how I display the error:

$scope.login = function(form){
            Authentication.login(form,function(data){
                    $scope.user = data;
                    $scope.modalLogin = false;
            },function(error){
                if(error.message=='Incorrect data'){
                    error.message = "Не вірне ім'я або пароль"
                }
                $scope.loginError = error;
            });
        };

update:
well, the template itself:
<code ng-show="loginError">{{loginError.message}}
update:
this way everything that passes through angular is displayed before being displayed on the page

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Dedukhin, 2015-06-09
@Deodatuss

The source code file in which you display the error is probably saved in cp1251.
Resave it as UTF8 without BOM.

M
Mikhail Osher, 2015-06-09
@miraage

The problem is not with angular, but with the charset of the page/response.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question