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

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

I have a problem with [the current situation in trunk 
demo|https://github.com/apache/ofbiz-framework/commit/04020d71d0]. 

Using Ubuntu 20.04 and last FF version when I edit WebStoreWarehouse facility 
([https://demo-trunk.ofbiz.apache.org/facility/control/UpdateFacility]) putting 
a non breaking space (NBSP) (using Alt Gr + Space) into "Default Days To Ship" 
e.g.
{noformat}
25 000
{noformat}
I don't get "25 000" with a whitespace but "25000" (with English locale)

I have the same problem with the last propositions applied locally
{noformat}
(using \p{Alnum} or \p{IsAlnum} and \p{Punct} or \p{IsPunct})
{noformat}
I get the same 25000

That's not different of what I get on stable demo where nothing has changed.

Do I miss something and if so what?

> String to numeric conversion does not support non-breaking spaces
> -----------------------------------------------------------------
>
>                 Key: OFBIZ-13168
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13168
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ALL COMPONENTS
>    Affects Versions: 18.12.16, Upcoming Branch
>            Reporter: Florian Motteau
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: Upcoming Branch
>
>         Attachments: Peek 05-11-2024 10-59.mp4, 
> image-2024-11-05-11-01-13-030.png
>
>
> When submitting a form with numeric values, OFBiz uses a text input (`<input 
> type="text"/>`), so all characters (entered by hand or pasted) are allowed in 
> the input.
> On form's submission, for numeric fields, the string is parsed using 
> `java.text.NumberFormat` class (parse method), using a number instance 
> formatter.
> This formatter does not supports non-breaking spaces ('\u00A0', '\u202F', 
> '\u2007'), and characters after a non-breaking space are ignored :
> !image-2024-11-05-11-01-13-030.png|width=337,height=153!
> This can lead to a situation where a visually correct form stores wrong 
> values :
> [^Peek 05-11-2024 10-59.mp4]
> One of our client reported this situation while pasting values from external 
> tools. Some values where truncated, because the external tool used 
> non-breaking spaces when displaying values.



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

Reply via email to