BOM or no BOM

  • 2 September 2022
  • 3 replies
  • 45 views

Userlevel 5
Badge +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(inputFileinputEncodingouputFileoutputEncodingnoBOM) to convert a file.
  3. The .json files created using dex::WriteToFile(dataFilemappingNamepretty) are UTF8 files without a BOM.

3 replies

Userlevel 1
Badge +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?

Userlevel 5
Badge +7

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

 

Userlevel 1
Badge +4

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

Reply


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

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