I know a little of the Legion's old ways when they used to take in criminals into their ranks so they could fight one last time for their country (obviously criminals with issues regarding the government are not allowed in), or how they took in outcasts from other countries. It used to be all volunteer. You join and fight for a cause, the French cause.
So, they weren't as safety-oriented as modern armies are with their soldiers. It wasn't a traditional fighting force that expected back-up or any kind of support. From what I was told, they rarely worked with the regular French. Thus they were better than a lot of other outfits just because they didn't need support, were loyal to the core, and fought to the death. They never questioned their superiors. It was very strict.
Because of this, I can understand why they would propose and even practice charging an ambushing force.
As many have said, it depends greatly on the terrain you're in, the size of your force, the distance to nearest friendlies, etc. However, I would consider trying to break through and make a gap in the ambushers to break out. If you are encircled, I've heard some teach to turn it into a small CP. Gather the wounded in a safe area, use obstacles for cover and literally dig in to fight off the attackers. I would not think of that as a viable solution to an encirclement as you are still no better off and are merely going to be shot at now in a comfortable setting. Forcing a break out gives you an offensive advantage. Retreating isn't an option and you can't hunker down.
Having said that, I'm assuming it is a well done ambush and you are surrounded or at least surrounded 75% of the way around.
Just my thoughts. What do I know?