Well,it seems that str_replace() doesn't work with arrays in Expression Manager.
You could do it with nested str_replace() statements but that gets real ugly with lots of characters. For example, this only does 2 characters:
Code:
str_replace("é", "e", str_replace("É", "E", str_replace("è", "e", str_replace("È", "E", q4_SQ001))))
I would be more inclined to do it with JavaScript. Adding this to the source of a multiple-short-text question will automatically load the second input without the French characters when you type or paste into the first input.
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Identify some elements
var thisQuestion = $('#question{QID}');
var input1 = $('li.question-item:eq(0) input.text', thisQuestion);
var input2 = $('li.question-item:eq(1) input.text', thisQuestion);
// Hide the second input
//$('li.question-item:eq(1)', thisQuestion).hide();
// Listener on the first input
input1.on('keyup', function(e){
repSpecChars();
});
input1.on('paste', function(e){
setTimeout(function () {
repSpecChars();
}, 100);
});
// A function to replace special characters
function repSpecChars(str) {
// The character arrays (must be same length
var specialChars = ["ù", "Ù", "û", "Û", "à", "Â", "ç", "Ç", "é", "É", "è", "È", "ê", "Ê", "î", "Î", "ô", "Ô"];
var nonSpecialChars = ["u", "U", "u", "U", "a", "A", "c", "C", "e", "E", "e", "E", "e", "E", "i", "I", "o", "O"];
var input1Val = input1.val().toString();
$(specialChars).each(function(i){
input1Val = input1Val.replace(
new RegExp(specialChars[i], 'g'),
nonSpecialChars[i]
);
});
input2.val(input1Val);
}
});
</script>