[Solved] Problem with XLF's MD5 hashcode

I want to get XLF content and save it as .xlf file. I use MD5 to check the file integrity. Everything works fine if I don’t add UTF-8 text in design.

This is the way I check the file integrity:

  1. Get Base64 code from CMS
  2. Decode Base64 to get byteArray
  3. Create MD5 from byteArray
  4. Compare with MD5 from RequiredFileResponse

So how can I get true XLF and use UTF-8 for design?

You need to make sure that when you decode you are doing so in the correct encoding. All content from the CMS should be UTF-8 encoded.

If you can share some code we might be able to comment further.

Thank you so much. I’ve found problem in my decode function. It’s return a string instead of byteArray (Uint8Array). I use this library to decode base64 to byteArray: