2

I've got an Excel file with text in Hindi which I'm trying to read via PHP but I only get gibberish out of it.

When I open the .xls File with Numbers, the text looks like this: enter image description here

But when I copy and paste this exact text here it looks like this:

ß[+kq'kh ge ij fuHkZj djrh gSAÞ

When I read it via PHP I get exactly the same gibberish text.

Is this an encoding problem in the .xls file and is it somehow possible to extract a UTF-8 encoded version from it?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
stdclass
  • 2,932
  • 2
  • 19
  • 16
  • An *.xls file uses a complex binary format so you must be using a third-party library. I suggest you check the parts of the library documentation regarding encoding. – Álvaro González Oct 30 '18 at 14:50
  • 3
    Your text is written in a custom font called "Kruti Dev 10" you can verify it by pasting and converting the gibberish [here](https://www.lakhimpurlive.com/font-convertor/). Simple answer this has nothing to do with encoding. While displaying in browser use "Kruti Dev 10" via css and it will render as hindi – Jaswinder Oct 30 '18 at 14:50
  • You were fortunate to find someone who was able to answer this in spite of the lack of detail / reproducibility. For vaguely related background and guidance for this type of question, perhaps see also https://meta.stackoverflow.com/questions/379403/problematic-questions-about-decoding-errors – tripleee Jan 12 '21 at 10:54

1 Answers1

3

Jaswinder Singh's comment fixed the Issue!

The text is written in a font called "Kruti Dev 010" which is just normal text but displayed as hindi letters.

By using this tool I could recover the texts to unicode.

Thanks Jaswinder!

stdclass
  • 2,932
  • 2
  • 19
  • 16
  • Hi, can you please help me encode UTF-8 hindi characters as follows: Hindi: कख UTF-8 Encoded: à¤à¤ I am working in C# and tried Encoding.Utf8.GetBytes with GetString but I only get hindi text i.e. कख – Prashant Agarwal Oct 07 '19 at 13:08
  • 1
    @PrashantGupta do not ask for support by commenting your issue under an answer. You should ask a new question. If the new question has a relationship with this page, you may add a link to this page in your new question and explain the relationship. – mickmackusa Jan 10 '21 at 15:36