Airton Gomes de Lima
Airton Gomes de Lima

Reputation: 1377

How i can set the charset on Jquery Chosen?

On this part of code of the Chosen component (http://harvesthq.github.io/chosen/), i translated to portuguese, and have this characters "ç" and "ã".

AbstractChosen.default_multiple_text = "Selecione algumas opções";

AbstractChosen.default_single_text = "Selecione uma opção";

AbstractChosen.default_no_result_text = "Desculpe, mas nem uma opção foi encontrada os termos digitados.";

The browser are rendering a "?"

I tried to use the html codes for this characters, but don't work.

Upvotes: 0

Views: 1262

Answers (2)

Airton Gomes de Lima
Airton Gomes de Lima

Reputation: 1377

I just put this to work:

 <script>
    $(document).ready(function () {
        $(document).tooltip();

        $(".chosen-select").chosen({
            allow_single_deselect: true,
            disable_search_threshold: 10,
            no_results_text: 'Nada encontrado!',
            placeholder_text_single: 'Selecione uma opção',
            placeholder_text_multiple: 'Selecione as opções',
            width: "200px"
        });
        $('.chosen-results').css({ "max-height": "100px" });
    });
</script>

Upvotes: 1

pegatron
pegatron

Reputation: 526

You can try to import chosen.js file adding charset tag like below;

<script type="text/javascript" 
  src="http://harvesthq.github.io/chosen/chosen.jquery.js"
  charset="utf-8">
</script>

Upvotes: 1

Related Questions