DXL Script with Special Characters cannot be Started from User Menu

Dear all,
I have a DXL script that requires special characters in regular expressions (e. g. degree character, German umlauts). If I load this script into DOOR's DXL Interaction window and start it from there, everything works well.

For my users I wanted to provide an entry in the DOORS menu bar. If I start the script by clicking on the script entry in the User menu, I receive an run-time error with following explanation:

-R-E- DXL: <Line:164> incorrect regular expression (Regular expression ends prematurely)-I- DXL: execution halted

 


If I remove the special characters from the script and just leave the 'normal' ones, the regular expression is completely interpreted by DOORS and the script starts without this runtime error. I've already tried to fix this by using the charOf function, but in this case the regular expressions did not work correctly.

I guess, that there's a different code page used for DXL interaction and menu based script handling.

Any ideas, how to solve this issue?

 


rdratlos - Tue Sep 13 07:15:59 EDT 2011

Re: DXL Script with Special Characters cannot be Started from User Menu
OurGuest - Tue Sep 13 09:17:17 EDT 2011

Sounds like an error in your script. Please post.

Re: DXL Script with Special Characters cannot be Started from User Menu
SystemAdmin - Tue Sep 13 10:34:28 EDT 2011

Check that your DXL script file is UTF-8 encoded

Re: DXL Script with Special Characters cannot be Started from User Menu
SystemAdmin - Tue Sep 13 10:36:34 EDT 2011

SystemAdmin - Tue Sep 13 10:34:28 EDT 2011
Check that your DXL script file is UTF-8 encoded

Some earlier discussion on similar problems https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14464927

Re: DXL Script with Special Characters cannot be Started from User Menu
rdratlos - Wed Sep 14 10:48:19 EDT 2011

SystemAdmin - Tue Sep 13 10:36:34 EDT 2011
Some earlier discussion on similar problems https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14464927

Thank you for your quick answers. Pekka and Mathias guided me in the correct direction.

Here's the solution how to proper handle DOORS DXL scripts with special characters, e. g. degree character, German umlauts:
The script must be saved using UTF-8 encoding! In addition, a pragma is required:
1. Add following line to your script:

pragma encoding, "UTF-8"


2. Save the script in UTF-8 encoding:
For those using UltraEdit as editor, you will find a good description here.

Re: DXL Script with Special Characters cannot be Started from User Menu
sivanbalaji - Fri Dec 09 03:06:16 EST 2016

I had similar issue when I was using umlaut characters in regular expression, the regular expression worked well to find strings with umlaut characters when it was ran in DXL Interaction window but not when it was run as a standalone script.

I coded those umlaut characters in hex, for example 'รค' as "\\xe4", in the regular expression that worked flawlessly. Later came to know the pragma solution from this thread and tried. That too worked flawlessly. Thanks.