Are you certain this is a foobar2000 bug? Some of the "problems" you're describing sound more like problems on the encoding/streaming end, not the playback end.
Yes, I am sure. I captured the raw stream to a file and I looked at it in a hex editor. Here are some examples of actual metadata in the stream:
StreamTitle='A-Ha - Take On Me';StreamURL='';
This is parsed as
%artist% = A
%title% = Ha - Take On Me
StreamTitle='Nina Simone - Black is the Color of My True Love's Hair [1964 NY session; stereo]';StreamURL='';
This is parsed as
%artist% = 'Nina Simone
%title% = Black is the Color of My True Love's Hair [1964 NY session
StreamURL is normally an empty string. I'm not sure how to get it to be anything different. I don't think it matters.
The station name and URL are only sent in the icy-name and icy-url headers at the beginning of the response:
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.8<BR>
icy-name:Edited for Privacy
icy-genre:
icy-url:http://edited.for/privacy/
content-type:audio/aacp
icy-pub:0
icy-metaint:8192
icy-br:128