0





125
1

I am trying to find a string from enum when I find Mär from enum it returns undefined it should return Mar value.

EnumClass

{'Jan' : 'Jan' , 'Feb' : 'Feb', 'Mär' : 'Mar'}

console.log(enumClass.monthLangDE[localeMonth]) //undefined

also when I do console.log(localeMonth) it displays Mär

Question author Jn-newbie | Source

0


1

So something is wrong with the encoding when

console.log(escape(localeMonth), escape('Mär')); //produces "M%E4r M%uFFFDr"

So make sure that the JavaScript code file is saved as UTF-8 and that the page is running as UTF-8

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

If that does not fix anything, than you can do:

{'Jan' : 'Jan' , 'Feb' : 'Feb', 'M\u00E4r' /*'Mär'*/ : 'Mar'}
Answer author Epascarello

Ask about this question here!