remove punctuation but not accents

I am using this code to remove the punctuation from a string.

str.erase(
remove_if(str.begin(), str.end(), static_cast<int(*)(int)>(&ispunct)),
str.end());

My problem is that the program crashes when i type in a word such as: responsabilità

I need the accent to NOT be removed or my program won't work properly.
Any ideas on how to do this?
What do you mean "it crashes"? What happens exactly? Is it crashing in std::erase() or sometime after that call?

What global locale are you using? What character set are you using?
Topic archived. No new replies allowed.