You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by Alexey Aphanasyev <al...@tangram-crm.com> on 2002/07/11 14:35:01 UTC

How can I substitute a string which contains native chars?

Hello,

I faced a problem using jakarta-oro-2.0.6.

I'm trying to substitute a string, which contains national characters.
but I got:

<quote>
java.lang.ArrayIndexOutOfBoundsException
at org.apache.oro.text.awk.AwkMatcher._search(Unknown Source)
at org.apache.oro.text.awk.AwkMatcher.contains(Unknown Source)
at org.apache.oro.text.regex.Util.substitute(Unknown Source)
at org.apache.oro.text.regex.Util.substitute(Unknown Source)
</quote>

The source code looks like this:

<quote>
PatternCompiler compiler = new AwkCompiler();
PatternMatcher matcher = new AwkMatcher();
Pattern pattern = compiler.compile("\n");
Substitution subst = new StringSubstitution("\\n");
// Substitute eol with escape sequence
String value = Util.substitute(matcher, pattern, subst,
	bundle.getString(key), Util.SUBSTITUTE_ALL);
</quote>

I have found in ORO docs the following:

"AwkMatcher only supports 8-bit ASCII. Any attempt to match Unicode
values greater than 255 will result in undefined behavior."

It that the case?

Is there any way to solve my problem?

Thanks in advance.

Alexey

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>