#txt to pdf#devanagari#unicode#troubleshooting#hindi pdf#encoding

Why Hindi Text Turns Into ???? in a TXT to PDF File

DocsSeva Team6 min read

Key takeaways

  • It is a font encoding limit, not a file encoding problem
  • The rupee sign becomes a question mark too, so type Rs. instead
  • Curly quotes, dashes and bullets are silently normalised
  • Print to PDF from your editor embeds the real font
  • Mangled Latin letters are a different bug that UTF-8 does fix

You typed the notice in Hindi, saved it as suchna.txt, converted it, opened the PDF — and every Devanagari word is a row of question marks. ????? ?? ????? ????. The English heading at the top came out perfectly. So did the dates and the phone number.

The instinct at this point is to blame the encoding and re-save the file. That will not help. The cause sits somewhere else entirely, and once you know where, the fix takes about ninety seconds.

It is the font, not the file

A PDF does not contain text the way a .txt does. It contains instructions to draw specific glyphs from a specific font, and every font in a PDF has an encoding — a lookup table that maps character codes to glyph shapes.

TXT to PDF builds your document using one of the fourteen standard PDF base fonts. These are the fonts every PDF reader on earth already has, which is why the output opens correctly on a ten-year-old office desktop and on a phone. The trade is that they use WinAnsi encoding, and WinAnsi covers roughly U+0000 to U+00FF. That is the Latin-1 range: English letters, digits, punctuation, and accented European characters.

Devanagari starts at U+0900. Bengali at U+0980. Tamil at U+0B80. Arabic at U+0600. None of them are anywhere near the range the font can address.

Rather than fail the whole conversion when it hits a character it cannot draw, the converter substitutes a question mark and carries on. You get a file instead of an error. You also get ????.

What survives and what does not

CharactersWhat you get
A–Z, a–z, 0–9, . , ; : ! ? ( ) [ ] / - _ @ #Exact
é ñ ü ç å ø ä ßExact
° § ± µ £ ¥ ¢ © ®Exact
Curly quotes, en dash, em dash, ellipsis, bulletNormalised to ' " - -- ... *
TabFour spaces
Arrows → ←-> and <-
हिन्दी, বাংলা, தமிழ், ગુજરાતી, ಕನ್ನಡ????
中文, 日本語, العربية, русский????
Emoji of any kind?? (most emoji cost two)
₹ (the rupee sign)?

That last row catches more people than the script problem does. The rupee sign is U+20B9, adopted in 2010, well outside Latin-1. A price list in English with ₹1,250 in every row comes out as ?1,250 throughout. Type Rs. 1,250 instead and it renders perfectly.

The other symptom, which is genuinely an encoding bug

There is a different failure that looks similar enough to confuse the diagnosis. If your output shows café instead of café, or ä where you expected ä, that is a real encoding mismatch — the file was saved in one encoding and read as another.

That one you fix exactly the way you first assumed: open the .txt in Notepad, File, Save As, set the Encoding dropdown to UTF-8, save, convert again. The converter reads UTF-8.

Two different problems, two different fixes. Question marks mean the character has no home in the font. Mangled Latin letters mean the bytes were misread.

Four ways to get Indic text into a PDF

1. Print to PDF from wherever you typed it

This is the best result and almost nobody's first thought. Open the file in Notepad, Word, or even a browser tab, press Ctrl+P, and choose Microsoft Print to PDF or Save as PDF as the destination. The application embeds the actual Devanagari font it is displaying, so the glyphs travel with the file. Text stays selectable and searchable. Costs nothing, installs nothing.

On Android, opening the .txt in Google Docs or any reader and using Print, Save as PDF does the same job.

2. Screenshot, then Images to PDF

Take a screenshot of the text as it appears on screen, or export it as a PNG from whatever app you typed it in, and feed the images to Images to PDF. It handles JPG, PNG, WebP, GIF, TIFF and BMP, runs in your browser, and lets you drag pages into the right order before it builds the file.

Every glyph is pixel-accurate because it is literally a picture of your screen. The cost is that the text is no longer text — no search, no copy, and it will look soft if someone prints it at A4 from a phone screenshot. For a one-page notice going on a noticeboard, that is a perfectly reasonable trade.

3. Do not route a Hindi Word file through the converter either

Worth saying explicitly: the DOCX to PDF path shares the same conversion engine and the same font limitation. DOCX to PDF extracts the raw text from your Word file and lays it out with the same standard font, so a Devanagari .docx produces the same question marks. Use Word's own Save As PDF for that file. It embeds the font properly.

4. If the Hindi is already on paper, you want the opposite tool

People sometimes arrive here trying to solve the reverse problem — they have a scanned Hindi document and want the text out of it. That is PDF OCR, which reads Devanagari along with a hundred-odd other languages and gives you back real, editable text. It runs entirely in your browser, and you can pick Hindi and English together for a bilingual page.

Catch it before you download

The conversion tool shows the finished PDF in a preview frame on the page before you press Download. Scroll it. If the body is a field of question marks, you have found the problem in five seconds instead of after emailing it to forty people.

If you are checking a PDF someone else sent you, drop it into PDF text extract — it pulls the raw text layer out, and a screen full of ? tells you immediately that the file was built through a Latin-only path.

Quick decision table

Your source textUse this
English notes, logs, code, transcriptsTXT to PDF
Latin with accents (French, German, Spanish names)TXT to PDF
Any Indic script, Arabic, Chinese, Japanese, KoreanPrint to PDF, or Images to PDF
English text containing ₹TXT to PDF, but type Rs.
Mixed English and Hindi in one documentPrint to PDF

None of this is a defect you can configure around inside the tool — there is no font selector, and adding one would mean shipping a font subset with every conversion. It is a real boundary, and the honest answer is to route non-Latin text a different way. The rest of the file-format conversions are listed under Converters if the next step is turning that finished PDF into something else.

DocsSeva Team

Published on November 11, 2026

Browse all tools

38 free document tools, no account required.

Browse all tools