[ 
https://issues.apache.org/jira/browse/OFBIZ-13167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17897126#comment-17897126
 ] 

Jacques Le Roux commented on OFBIZ-13167:
-----------------------------------------

Hi Nicolas,

I tested and I did not get "my char &eacut;..." but "my char…te" which anyway 
makes more sense to me. Is that right ? If so +1.

> Truncate string with special character
> --------------------------------------
>
>                 Key: OFBIZ-13167
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13167
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework/widget
>            Reporter: Nicolas Malin
>            Assignee: Nicolas Malin
>            Priority: Minor
>
> On model form, when you use a field description with a text size like :
> {code:java}
> <form...>
>     <field name="myfield" ...><display size="10"/></field>
> </form>{code}
> and your field myField contains a string with a special character like "my 
> char é, so bad truncate", the widget rendering displays "my char &e..." 
> because when truncate is executed, the string is encoded and some chars are 
> encoded : "my char &eacut;, so bad truncate".
> The size between the encoded string and the displayed string are different. 
> So to fix this, we implemented a new method to truncate the content. This 
> method identify each special char as one char, and truncate.
> "my char é, so bad truncate" encoded to "my char &eacut;, so bad truncate" 
> become "my char &eacut;..." and not "my char &e..."



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to