-1

I've a text as Bharat written in hindi in PDF.

I am creating a web page where in i need to display this as it is in my webpage. when trying to copy the content and paste it is getting rendered as some garbled text. I've installed the corresponding font and when seen in ms-word it is showing correct, can you please let me know how can i show/display it as it is.

I get the below when i paste it directly.

fpfdRlh;

Thanks

user3872094
  • 3,269
  • 8
  • 33
  • 71
  • 1
    Would be nice to see what you have tried with so far. – Gustaf Gunér Jan 22 '15 at 12:04
  • Hi @Gustaf, nothing was done, i just directly copy pasted the data. and this was issue – user3872094 Jan 22 '15 at 12:14
  • The problem lies in your PDF [\*]. See http://stackoverflow.com/questions/6637633/parsing-pdf-files/6657121, http://stackoverflow.com/questions/24107759/strange-behaviour-of-a-pdf-to-text-conversion, and many, many more. [\*] Or with your expectations. The PDF format does not guarantee "exact copying of text is always possible". – Jongware Jan 22 '15 at 12:33

1 Answers1

3

Make sure you save the files as using UTF-8 encoding. Also use UTF-8 as the webpage's charset in the head.

<meta charset="utf-8" />

EDIT: I just tried this and it works great for me. Could it be a browser issue?

Code I tried for reference:

<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
    <h1>देवना</h1>
</body>
</html>

And a JsFiddle for you: http://jsfiddle.net/zuymyz00/

Isak
  • 365
  • 3
  • 11