Passing VHDL string generic with spaces via Modelsim command line
Your command line translates to these parameters:


"vsim"
"-c"
"work.foo"
"-gVAL=\"a"
"b"
"c"
"d\""


You need to enclose the wohle parameter in quotes:

vsim -c work.foo "-gVAL=a b c d"


The application will see these parameters:


"vsim"
"-c"
"work.foo"
"-gVAL=a b c d"