0

Controller

app.controller('infoController', ['$scope', function($scope) {

    $scope.companies = [
        {
            name: "日本語",
            id: '1',
            state: false
        },
     {
        name: "blaa",
        id: '2',
        state: false
    }
    ];

    $scope.showHide = function(c) {
        c.state = !c.state;
    };

}]);

and this in my html:

 <li ng-repeat="company in companies"> <p class="ng-cloak" style="display: inline">{{company.name}}</p>
    <a class="showLink" ng-click="showHide(company)" href="">もっと情報</a>

...

however, the company.name is displayed as ???? but any other japanese text is displayed just fine. Can you tell me what is the reason and how to fix it? I have included UTF8 in my html file.

Pankaj Parkar
  • 134,766
  • 23
  • 234
  • 299
Muninmuni
  • 33
  • 4
  • 2
    Seems fine for me http://plnkr.co/edit/g8g86vKcjtevrLXQhlYY?p=preview I think your machine should have installed have that font – Pankaj Parkar Aug 09 '15 at 18:46
  • oh ok, thanks! but for example if a user has the same configuration for his machine as mine and it displays it as "???", how can I fix that? and if my machine is the problem, why everything else works ok? – Muninmuni Aug 09 '15 at 19:02
  • @Polly You'll want to load the font in via CSS or use a web friendly Japanese font. Check out this thread: http://stackoverflow.com/questions/14563064/japanese-standard-web-fonts – James Ives Aug 10 '15 at 02:58
  • thank you! I will give it a try! = ) – Muninmuni Aug 11 '15 at 21:10

2 Answers2

0

Try to use UTF-8 encoding for your javascript file.

Shawn Song
  • 301
  • 1
  • 9
0

It's not a problem of Angular, it's a problem with your encoding! Looks like your *.js file is encoded in wrong encoding. To do it just open your file with notepad++, press Encoding Tab on the top of notepad++ and press encode in UTF-8.

Maris
  • 4,608
  • 6
  • 39
  • 68
  • so it turned out problem is the IDE that I am using, because even when saving it with notepad it changes it after, thank you very much! = ) – Muninmuni Aug 12 '15 at 19:45