Bug 113992 - Unable to replace unicode (\u####)
Summary: Unable to replace unicode (\u####)
Status: RESOLVED DUPLICATE of bug 106137
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.6.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find-Search
  Show dependency treegraph
 
Reported: 2017-11-22 13:04 UTC by Ulrich Windl
Modified: 2017-11-23 06:01 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Windl 2017-11-22 13:04:51 UTC
Description:
In "Find & Replace" no Unicode escape sequence (\u####) is recognized for the text to substitute. This makes is impossible to solve some replacement tasks, like replacing a paragraph break with a line break.

Steps to Reproduce:
1. Have a text with '°' in it
2. Try to replace '°' with a line-break (not a paragraph break)


Actual Results:  
It does not work (it's not possible)

Expected Results:
It should work (it should be possible)


Reproducible: Always


User Profile Reset: No



Additional Info:
See also https://ask.libreoffice.org/en/question/55740/i-am-trying-to-replace-the-paragraph-charachters-with-line-break-cant-figure-it-out-dosent-have-option-for-paragraph-break-or-does-it-or-i-cant-figure/


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 V Stuart Foote 2017-11-23 03:51:20 UTC
The hex Unicode value \u00b0 search string picks up the "°" in a Find & Replace dialog with Other Options -> Regular Expressions checked.  While our "\n" replacement results in paragraph breaks.

This works as expected.

=-Testing-=
On Windows 10 Home 64-bit en-US (ver 1709)
Version: 5.4.3.1 (x64)
Build ID: 32c8895c6cae21571f364dbb059f419a743ee44d
CPU threads: 4; OS: Windows 6.19; UI render: GL; 
Locale: en-US (en_US); Calc: group
Comment 2 V Stuart Foote 2017-11-23 06:01:39 UTC
Rereading this, guess this could be considered a duplicate of bug 106137 if you are asking to parse the Unicode for use in the replacement string.

The Replace string can not be RegEx based because our Regular Expression support in the Find & Replace dialog uses ICU libraries for its direct Unicode support. 

The Replace field does not implement its own RegEx beyond using the ICU pattern matching buffers available from Find [1].

In the see also, devs suggest they may be able to provide new parser to enter replacement text with \u or \U syntax but that it would not be fully functional RegEx.

=-ref-=
[1] http://userguide.icu-project.org/strings/regexp

*** This bug has been marked as a duplicate of bug 106137 ***