Skip to main content

BOM or no BOM

  • Sep 2, 2022 4:52 PM UTC
  • 3 replies
  • 129 views

Chris Kuip
AIMMSian
Forum|alt.badge.img+7

Recently one of our customers encountered a REST API that didn't accept Json UTF8 files starting with a Byte Order Mark (BOM). By default, the PUT files created by AIMMS are UTF8 files with a BOM at the start to mark these files as UTF8 files.

There are some ways to circumvent this issue:

  1. Set the hidden AIMMS Project Setting "Default output character set” to UTF8NoBom.
  2. Use the function dex::ConvertFileToEncoding(inputFile, inputEncoding, ouputFile, outputEncoding, noBOM) to convert a file.
  3. The .json files created using dex::WriteToFile(dataFile, mappingName, pretty) are UTF8 files without a BOM.

3 replies

Forum|alt.badge.img+4

@Chris Kuip, I face the same problem with a customer I want to circumvent the BOM character by changing the project setting, but I can’t select the option ‘UTF8NoBom’ from the list. (using aimms 24.3). Has the option been removed or do I miss something?


Chris Kuip
AIMMSian
Forum|alt.badge.img+7
  • Author
  • AIMMSian
  • Apr 23, 2024 11:35 AM UTC

Hi Marc,

 

It looks like you are checking the option 'Default output character encoding’ instead of ‘Default output character set’.  Can you check?

 

With kind regards,

 

Chris

 


Forum|alt.badge.img+4

Yes, my mistake (it was hidden indeed). I found it now, thanks!


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator