Question

I am using the jQuery TimeAgo pluggin and I am loading the below file for my specific language :

// Portuguese
jQuery.timeago.settings.strings = {
   suffixAgo: "atrás",
   suffixFromNow: "a partir de agora",
   seconds: "menos de um minuto",
   minute: "cerca de um minuto",
   minutes: "%d minutos",
   hour: "cerca de uma hora",
   hours: "cerca de %d horas",
   day: "um dia",
   days: "%d dias",
   month: "cerca de um mês",
   months: "%d meses",
   year: "cerca de um ano",
   years: "%d anos"
};

My issue is that I am getting some :

<abbr class="timeago" title="Janeiro 8, 2014">menos de um minuto atr�s</abbr>   
Was it helpful?

Solution

This character � is usually the sign of an invalid (non-UTF-8) character showing up in an output (like a page) that has been declared to be UTF-8.

The reason is probably that your script Portuguese is stored in the wrong encoding (e.g. Windows-1252 instead of UTF-8) - make sure it's saved as a UTF-8 file. The setting is often in the "Save as..." dialog.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top