Page 1 of 1

Unicode find/replace in regular expressions

Posted: Thu May 25, 2006 10:23 pm
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.)

Correction to question

Posted: Thu May 25, 2006 10:47 pm
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".

Posted: Fri May 26, 2006 10:37 am
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

Posted: Fri May 26, 2006 4:37 pm
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