Literary Chinese (Vietnamese: Văn ngôn 文言, Cổ văn 古文 or Hán văn 漢文[1]) was the medium of all formal writing in Vietnam for almost all of the country's history until the early 20th century, when it was replaced by vernacular writing in Vietnamese using the Latin-based Vietnamese alphabet. The language was the same as that used in China, as well as in Korea and Japan, and used the same standard Chinese characters. It was used for official business, historical annals, fiction, verse, scholarship, and even for declarations of Vietnamese determination to resist Chinese invaders.