ex: BREAD is P% C3% 83O , when I test the app on localhost the accents work fine but when hosting stays like this Bread
strong> ???I made this exmplo
<form name='meuForm' method='post' action='action' id='formStr'>
<input type='text' name='str1' value='palhação' id='str1' />
<input type='text' name='str2' value='Fábio' id='str2' />
<input type='submit' id='teste' valiue='testar' /> </form>
$( "form" ).on( "submit", function( e ) { e.preventDefault(); var str1 = $('#str1').val(); var formSerializado = $(this).serialize(); console.log( 'str1 = '+str1+', formSerializado = '+ formSerializado ); });
In console.log () it gets
str1 = palhação, formSerializado = str1=palha%C3%A7%C3%A3o&str2=F%C3%A1bio
And I would like to understand why when I have the value of var str1 the value is right and when serializes it gets weird, I think it's the same reason my app is giving accent problem.
To avoid problem with site use <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
on every page.
Is there a way to encode when serializing?