Give buffers in experimental fpdf_annot.h APIs clearer types.

Change some buffer parameters' types from void* to FPDF_WCHAR*. Then:

- Clarify in the documentation that the buffer length is in bytes.
- Change callers to use containers of FPDF_WCHAR instead of char.
- Change callers to avoid casting and converting FPDF_WCHAR to char.
- Add GetFPDFWideStringBuffer() to help create std::vector<FPDF_WCHAR>
  without having to byte length to FPDF_WCHAR count conversions.
- Remove BufferToWString() and BufferToString() helpers.
- Check the md5sum of a large buffer, instead of just the two ends.

The affected APIs are:

- FPDFAnnot_GetStringValue()
- FPDFAnnot_GetAP()
- FPDFAnnot_GetOptionLabel()

Change-Id: Ie4fd1831af97221ea74d4353be2456758d6a945e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/52872
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp
index 8087e12..17d90cc 100644
--- a/testing/fx_string_testhelpers.cpp
+++ b/testing/fx_string_testhelpers.cpp
@@ -70,3 +70,8 @@
   result_span[i] = 0;
   return result;
 }
+
+std::vector<FPDF_WCHAR> GetFPDFWideStringBuffer(size_t length_bytes) {
+  ASSERT(length_bytes % sizeof(FPDF_WCHAR) == 0);
+  return std::vector<FPDF_WCHAR>(length_bytes / sizeof(FPDF_WCHAR));
+}