Unicode find/replace in regular expressions

Having trouble installing Oxygen? Got a bug to report? Post it all here.
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Unicode find/replace in regular expressions

Post by dsewell »

Using the "regular expression" option in oXygen 7.1 Find/Replace, I can find a character using Perl \uNNNN syntax, but I cannot use that syntax to replace. For example, to search for é (accented 'e', U+00e9) it works if I put

Code: Select all

\u00e9
in the "Text to find" field, but if I want to replace the character with è, U+00e8, it does not work to put

Code: Select all

\u00e8
in the "Replace with" field. Instead, the replacement is literal 'u00e8'.

Is this a bug, or am I misunderstanding how Perl regex syntax works?

(I realize that I can use an XML numeric character entity as a workaround, or for that matter I can just input the UTF-8 character from my keyboard, but I have some use cases where it would be more convenient to use \u syntax.)
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Correction to question

Post by dsewell »

Actually, I guess that \uXXXX syntax is from Java rather than Perl--I still don't understand why it works in "find" but not "replace".
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello David,

Currently Unicode characters are not supported as \uNNNN expressions in the Replace field. We will consider supporting them in a future version. You have to use the character directly, that is the character é. If you set a Unicode font capable of rendering the needed character in Options -> Preferences -> Fonts -> Text components you can see the character rendered correctly in the Replace field.

Regards,
Sorin
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Post by dsewell »

sorin wrote:Currently Unicode characters are not supported as \uNNNN expressions in the Replace field. We will consider supporting them in a future version. You have to use the character directly, that is the character é. If you set a Unicode font capable of rendering the needed character in Options -> Preferences -> Fonts -> Text components you can see the character rendered correctly in the Replace field.
Thanks for the clarification,

David
Post Reply