Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
8 replies
Subscribers
8 subscribers
Views
3945 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi I'm getting an exception when trying to use the torecord() fun
normanc
over 10 years ago
Hi
I'm getting an exception when trying to use the torecord() function on extended characters. For example, if I have the rule...
=torecord("<tag>eg</tag>", "")
...then the text "eg" is returned in the test rules interface. However, if there is an extended character, e.g...
=torecord("<tag>ég</tag>", "")
...then I get an error message "The rule contains an expression that cannot be tested". On checking the application server log the message is "MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence".
Are we missing some setup configuration? We are using Appian 7.4 with IIS and JBOSS.
Thanks,
Norman.
...
OriginalPostID-124059
OriginalPostID-124059
Discussion posts and replies are publicly visible
0
Aleksi White
Appian Employee
over 10 years ago
Are you testing the function like this in isolation? Or is it being used as part of a larger XML document? If you have XML headers, try removing the ones such as:
<?xml version="1.0" encoding="UTF-8"?>
<Instruction xmlns="
http://tempuri.org/">
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
normanc
over 10 years ago
I am testing the function with the xml fragment as shown, so there are no headers.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Aleksi White
Appian Employee
over 10 years ago
I was able to reproduce the error in 7.4. However, when testing in 7.5 and 7.6, this function with the special character gives the result as ?g, rather than erroring out. This is a bit more graceful, so we know the behavior has been updated in later versions of Appian.
The root issue seems to be that the document isn't encoded in UTF-8, even though it is being read as if it were. There might be a limitation on this working by itself (as you are testing in the expressions editor), but we have seen cases where this works properly with special characters when populating a CDT in a full XML document, and stripping out the headers as I mentioned above.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
normanc
over 10 years ago
Thanks Aleski.
The error can be reproduced outside of the expressions editor.
There does seem to be some mis-handling of the character set encoding within Appian. The xml fragment is encoded as UTF-8 originally, but this seems to be re-encoded as ISO-8859-1 and then treated as UTF-8 which causes the error.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Aleksi White
Appian Employee
over 10 years ago
When you reproduce it outside of the expressions editor, is it still just as a standalone function? What is the use case for using it like this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
normanc
over 10 years ago
The actual problem is that we ase passing UTF-8 encoded XML from the database and Appian is re-encoding it as ISO-8859-1. I have raised a support case.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Aleksi White
Appian Employee
over 10 years ago
I see that we have provided a workaround in that case. For reference, it is to use something like:
torecord("<?xml version='1.0' encoding='ISO-8859-1'?><tag>ég</tag>", "")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
normanc
over 10 years ago
With Appian Support's help, we have configured JBoss JVM settings with UTF-8 as the default file encoding. This step is missing in the online documentation.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel