1

I'm working in a project and I'm facing a problem. I have some client stored in database, lets say one of them is Novák. Now I'm using jQuery (autocomplete), in order to get the clients in the client text field when I want to search. The problem is that, I'm geting Nov& #225;k instead of Novák. I have searched for an answer but could not find the correct one.

<script>
    var availableWorkers = new Array();
    @foreach(var w in selWorkers) {
        var worker = w.fullName;
        @:availableWorkers.push(@worker);
    }
    $(".workerTag").autocomplete({
        source: availableWorkers
    });
</script>

So, I think I have to add something here:

@:availableWorkers.push(@worker);

Thank you. All the best.

  • Try to verify that you use UTF-8 as the encoding of your database and your files – Mahmoud Jun 14 '18 at 09:56
  • Thank you @Mahmoud for your answer. I figured out a way, I found it useful somewhere here. For all those that have same issue like me, I used this: https://stackoverflow.com/questions/7394748/whats-the-right-way-to-decode-a-string-that-has-special-html-entities-in-it?lq=1 – Festim Kamberi Jun 14 '18 at 10:10

0 Answers0