Sure the exceptions to rule exist. But in general resist to a cavalry charge with swordmen isn't a very good idea I saw. Too many losses. Better attack when the cavalry is fixed or in coordination with other cavalry.
The pike of not-western are better (like many others units type). but they are also high-priced