China is joining France and Britain in announcing plans to end sales of gasoline and diesel cars.