Skip to content

InputTextarea and emoji #3483

Closed Answered by DazzlingBob
DazzlingBob asked this question in PrimeFaces
Jan 29, 2025 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Tried countBytesAsChars="true" but that gives a javascript error:
jquery.js.xhtml?ln=primefaces&v=14.0.11:2 jQuery.Deferred exception: URI malformed URIError: URI malformed
at encodeURI ()

Setting countBytesAsChars="false" solves it. See project: primefaces-test-texarea.zip
Open project and see javascript console. Could be a bug?

Let me explain: in the database i have a field which can hold 10 utf-8 chars.
So i thought the solution is to set maxlength=10, but i can only enter 5 utf-8 characters in the textarea.
This is exact the same behavior as a normal html textarea (did not know this before).

So in the html spec maxlength is a number of bytes and not the number of displayed characters …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@melloware
Comment options

@melloware
Comment options

Answer selected by melloware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
2 participants