jsf - Euro symbol on Primefaces Ajax update -


i trying write euro currency symbol on page. works perfect when load page, when make partial update through ajax euro symbol not being loaded correctly. tried 3 different approaches:

<h:outputtext value="&euro;" /> <h:outputtext value="&#x26;euro;" /> <h:outputtext value="€" /> 

when loading page, works first approach. results following:

€ euro; € 

when making partial update ajax, none of them works correctly:

? &euro; € 

same result above when implementing filter described in unicode input retrieved via primefaces input components become corrupted

i spent entire day trying solve this. appreciate help.

thanks, douglas.

the answer found applies decoding of http request parameters (the submitted form values). not applicable in case. you've problem encoding of http response (the html/xml output generation).

the encoding of http response can controlled in @ least 2 ways:

  • the encoding declared in <f:view encoding>, defaults utf-8. can programmatically set via externalcontext#setresponsecharacterencoding(), not done jsf developer.
  • the encoding used save physical template file. not influence encoding being used during generating html/xml output, influence how characters treated. if template file saved using different encoding <f:view encoding>, such iso-8859-1, characters may end mojibake.

in particular case, provided didn't modify <f:view encoding> (you otherwise more have explicitly mentioned in question), probable cause template files saved using wrong encoding. in turn configured in editor itself. if it's example eclipse, need set via window > preferences > general > workspace > text file encoding.

enter image description here

see also:


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -