cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Translate the entire conversation x

String replace function working in command line but not in .acl

AP_13279061
4-Participant

String replace function working in command line but not in .acl

I am using Arbortext 8.3.  Here is the simple function in question:

replace("ʼ", "’", 0x2000);

The user has a file that contains a mix of apostrophes.  We want a consistent character used.  The first apostrophe is the U+02BC : MODIFIER LETTER APOSTROPHE {apostrophe} and the second (the desired one) is U+2019 : RIGHT SINGLE QUOTATION MARK {single comma quotation mark.

Using the following text, the last apostrophe is the one we want swapped.

la Loi sur les traitements, aux ministres d’État qui sont à la tête d’un département dʼÉtat

Using the replace function above, if I run from the command line in Arbortext Editor it works perfectly.

AP_13279061_0-1767121455643.png

 

However, when I save that one line of code, as its own ApostropheSwap.acl file, and do a "source ApostropheSwap.acl", it does not find a match.

 

AP_13279061_1-1767121664726.png

 

I have tried saving the .acl file as UTF-8 and ANSI, and both get the same result.

 

Any ideas would be greatly appreciated.

Thanks

ACCEPTED SOLUTION

Accepted Solutions

It is probably an issue with the special characters you're using. It may help if you use the chr() function instead of the literal character, something like this:

replace(chr(0x02bc), chr(0x2019), 0x2000)

I did a quick test from an ACL script file and this seems to work for me.

View solution in original post

4 REPLIES 4

If you open the map as a resolved document for editing (edit, edit resolved document) you can also do a find and replace that way.

 

Bryon

AP_13279061
4-Participant
(To:bfriesen)

Yeah, the regular Find/Replace dialog works, but I really wanted a solution that doesn't require the user to have to do much.  The users are lawyers and dont want to be copying different apostrophes into text boxes.  At this point the simplest solution is for the user to paste the function in the command line.   And that is not a very polished solution.  

I am hoping someone knows how to get that little command to work from within .acl

It is probably an issue with the special characters you're using. It may help if you use the chr() function instead of the literal character, something like this:

replace(chr(0x02bc), chr(0x2019), 0x2000)

I did a quick test from an ACL script file and this seems to work for me.

Thank you.    The chr() function did the trick.

Announcements

Top Tags