jakartaee / faces

Jakarta Faces
Other
108 stars 55 forks source link

Faces Standard Converters: ignore all Unicode leading and trailing space(s) #1953

Open pizzi80 opened 3 months ago

pizzi80 commented 3 months ago

use String.strip instead of String.trim to remove all Unicode spaces:

https://jkorpela.fi/chars/spaces.html

In general both method removes leading and trailing spaces from string. However the difference comes when we work with unicode charaters or multilingual features.

trim() removes all leading and trailing character whose ASCII value is less than or equal to 32 (‘U+0020’ or space).

According to Unicode standards there are various space characters having ASCII value more than 32(‘U+0020’). Ex: 8193(U+2001).

https://stackoverflow.com/questions/51266582/difference-between-string-trim-and-strip-methods-in-java-11