I once read a short story about a man (a journalist?) visiting a prison inmate. He was incarcerated for a crime he did not commit, and it was a case of mistaken identity or insufficient alibi. The conviction hinged on the fact that he could not prove that he was really himself because he could not remember the location of a country he had been to. The story ended with the journalist leaving the prison making a note to himself to remember things so as to not be in such a situation himself.
Please identify the story. I must have read it a decade ago, but the story itself was probably very old (a century old or more, think O.Henry/Maupassant/Hawthorne…). I read the story in English, but it could have been a translation.