Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. removeAccents(const string[], dest[], len = sizeof dest)
  2. {
  3. static const ACCENTS[] = "ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž";
  4. static const NON_ACCENTS[] = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
  5.  
  6. format(dest, len, string);
  7.  
  8. for (new i = strlen(string); i > -1; --i)
  9. {
  10. for (new c; c < sizeof ACCENTS; ++c)
  11. {
  12. if (string[i] == ACCENTS[c])
  13. {
  14. dest[i] = NON_ACCENTS[c];
  15. }
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement