Factual error: Jack Sparrow says he loves the French because "they invented mayonnaise." The film is set in the 1750s. The egg-based sauce known as mayonnaise was developed in the early 1800s. The Oxford English Dictionary says the word dates from 1815.
Factual error: The British Ship of the Line is flying a version of the British Union Jack that was not adopted until 1801. The story is supposed to take place between 1720 and 1750.
Answer: Jack could've been sent by his former captain to obtain it from Tia Dalma.