We have a Customer
table with the "First name" and "Last name" columns. There are million of records in the table. Few of the records have French Accented charaters.
Example: Adélaïde, Amélie , etc.
I am looking for a DB2 function that can convert or translate accents into base ASCII characters.
Example:
Input: Amélie
Output: Amelia
I know we have a solution in Java. We can use Apache Commons StringUtils
library to convert.
String input = StringUtils.stripAccents("Tĥïŝ ĩš â fůňķŷ Šťŕĭńġ");
System.out.println(input);
As of release 3.4, this does not work for Ø or Ł.
Below solution works and covers all the characters. translate(col,'aAeEiIoOuUaAeEuUaAeEiIoOuUeEiIoOuUcCnNaaaiAAAIoOyydDYooOOA','áÁéÉíÍóÓúÚàÀèÈùÙâÂêÊîÎôÔûÛëËïÏöÖüÜçÇñÑäãåìÄÃÅÌøØÿýðÐÝòõÒÕæ')
Note: æ is converted to A