1

I tried to post characters such as "āēīū" from a form in a PDF viewer to a web server, but on the server side those characters look like this: "????". What can I do to pass these characters as UTF-8?

Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165
Arturs Soms
  • 489
  • 4
  • 17
  • This looks like an encoding problem. Are you sending/receiving the characters as UTF-8? I'm pretty sure that the problem is caused outside iText. It is unclear what you mean when you say "I'm using iText to post data" because iText doesn't post any data. iText is not a PDF viewer. You'll have to clarify. – Bruno Lowagie Sep 19 '14 at 09:59
  • @BrunoLowagie True, i'm using itext to read posted data. i'm receiving data as utf-8. looks like adobe reader which is embeded to firefox send invalid data. – Arturs Soms Sep 19 '14 at 10:04
  • That's probably not Adobe Reader, but pdf.js ;-) As for submitting data from a form. There is a flaw in ISO-32000-1. I have made sure that this will be fixed in ISO-32000-2, but in the meanwhile please read the answer I found to one of my own questions: http://stackoverflow.com/questions/12604171/data-encoding-when-submitting-a-pdf-form-using-acroform-technology – Bruno Lowagie Sep 19 '14 at 10:06
  • @BrunoLowagie i tried to check firefox post to server with firebug. And it doesn't show any posted data, but i see in server those characters comes as "???". Is there any way how to check what was posted to server using adobe reader in Firefox? I'm using FDF format for data posting. – Arturs Soms Sep 19 '14 at 10:08
  • I've updated your question to make it more accurate. Are you sure you are using Adobe Reader and not pdf.js? I don't think there's a easy way to intercept the bytes sent from the Adobe Reader plugin. Or rather: I don't know a way to do this, but somebody else may. I'll update the tags of your question (and up-vote it). – Bruno Lowagie Sep 19 '14 at 10:11
  • @BrunoLowagie yeah, i'm using adobe reader, i'm sure. – Arturs Soms Sep 19 '14 at 10:20
  • Hmm... as you can see from my question about submitting Chinese, I've been able to submit special characters to the server. I use this servlet to test all the bytes that arrive on the server: http://itextpdf.com/examples/iia.php?id=169 I guess you're doing something similar... – Bruno Lowagie Sep 19 '14 at 10:26

1 Answers1

0

Use xml or xfdf posts. Encoding doesn't work for html, fdf posts.

Arturs Soms
  • 489
  • 4
  • 17