6
I am using the primefaces component. My problem is that it is recording the accents that the user type into the text without doing the proper Escaping HTML. There’s a way to change this so he knows that the letter is an accent and needs to perform the proper Escaping HTML?
Below follows the code:
<p:editor id="corpoEmail" widgetVar="editorWidget" value="#{corpoEmailControl.corpoEmail}" width="700" maxlength="2000" />
You know that not everything the user can type is in the ASCII table, right? Are you sure you didn’t mean UTF-8 or Unicode?
– Victor Stafusa
I wish instead of him recording the accent records the asciii code. Example: the user types gas and he records gás I will use this text to send an email, if I let the accent the browser of the person who receives this email will not recognize the accent.
– Renato Romão
Or whatever you want him to record
g´s
instead ofgás
?– Victor Stafusa
Yes, as I said this text will be sent in the body of the email.
– Renato Romão
Okay, but in this case you have to agree that what you want is to escape the characters that are not in the 7-bit ASCII/ANSI table. This is something very different from "do not write ASCII code".
– Victor Stafusa
I edited the question to be clearer, I hope you agree with my edition.
– Victor Stafusa
Okay. I just hope I get the answer. I’m looking on the internet.
– Renato Romão
I’m thinking about replacing the string in every possible accent.
– Renato Romão
Guys I ended up using this class Stringescapeutils the problem that it converts everything up to html tags.
– Renato Romão
@Renatoromão, it would be interesting to post as an answer how you solved the problem
– Wellington Avelino