arduino-builder compiles into binary string not hex

hi there,

i have been playing with the official official arduino-builder from arduino.cc

i have managed to successfully compile a sketch

void setup() {};\nvoid loop() {};

and the result is a JSON object

{
  "hex": "OjEwMDAwMDAwMEM5NDlCMDAwQz...[lots more omitted]",
  "id": "2a8fd66d-3cff-44d2-9e10-2f861dbab7bc",
  "stderr": "",
  "stdout": "arduino-builder\/arduino-builder -compile -core-api-version 10611 -build-path \/tmp\/410500705 -hardware arduino-builder\/hardware -hardware arduino-builder\/packages\/cores -tools arduino-builder\/tools -tools arduino-builder\/packages\/tools -built-in-libraries arduino-builder\/latest -libraries \/tmp\/386530442\/pinned -libraries \/tmp\/386530442\/custom -fqbn arduino:avr:leonardo -verbose=false \/tmp\/386530442\/empty\nWARNING: Category '' in library ArduinoUnit is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Parse Arduino SDK is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Pushetta is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library SparkFun MG2639 CellShield is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library StereoSID is not valid. Setting to 'Uncategorized'\n"
}

you can play this example here on create.arduino.cc

if you preview the developer console network tab you'll see the request params

Anyway, as you can see from the above JSON, the hex returned is a compiled binary

{
  "hex": "OjEwMDAwMDAwMEM5NDlCMDAwQz...[lots more omitted]",
  "id": "2a8fd66d-3cff-44d2-9e10-2f861dbab7bc",
  "stderr": "",
  "stdout": "arduino-builder\/arduino-builder -compile -core-api-version 10611 -build-path \/tmp\/410500705 -hardware arduino-builder\/hardware -hardware arduino-builder\/packages\/cores -tools arduino-builder\/tools -tools arduino-builder\/packages\/tools -built-in-libraries arduino-builder\/latest -libraries \/tmp\/386530442\/pinned -libraries \/tmp\/386530442\/custom -fqbn arduino:avr:leonardo -verbose=false \/tmp\/386530442\/empty\nWARNING: Category '' in library ArduinoUnit is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Parse Arduino SDK is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Pushetta is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library SparkFun MG2639 CellShield is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library StereoSID is not valid. Setting to 'Uncategorized'\n"
}

when in actuality i am expecting something like this

{
  "hex": "":100000000C942D010C9455010C9455010C94550140\r\n:...[lots more omitted]",
  "id": "2a8fd66d-3cff-44d2-9e10-2f861dbab7bc",
  "stderr": "",
  "stdout": "arduino-builder\/arduino-builder -compile -core-api-version 10611 -build-path \/tmp\/410500705 -hardware arduino-builder\/hardware -hardware arduino-builder\/packages\/cores -tools arduino-builder\/tools -tools arduino-builder\/packages\/tools -built-in-libraries arduino-builder\/latest -libraries \/tmp\/386530442\/pinned -libraries \/tmp\/386530442\/custom -fqbn arduino:avr:leonardo -verbose=false \/tmp\/386530442\/empty\nWARNING: Category '' in library ArduinoUnit is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Parse Arduino SDK is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Pushetta is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library SparkFun MG2639 CellShield is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library StereoSID is not valid. Setting to 'Uncategorized'\n"
}

thoughts?

I don't use the arduino-builder. When I need a hex file of an Arduino sketch, the IDE is able to export the hex file. You can find this feature under the "Sketch" menu.

Xloader will then upload the hex file to another Arduino. Dozen times done without any problem.

The hex section looks like something base64 encoded. What do you get when you decode it as base64?