Page is in the windows-1251 encoding, SVG embeded as objects. Then there is an attribute fill on tspan tag, the text is corrupted and Safari shows encoding error. The same svg code without fill attribute works perfectly. If page is in utf-8 both svg's works.
Created attachment 20327 [details] How it looks
Created attachment 20328 [details] Test page
On 10.5 with Safari 3.1, both variants are displayed incorrectly. Also, having the main page in UTF-8 doesn't help. Marking as regression. I think that this is a data: URL issue, not something related to SVG. For whatever reason, the two subresources are encoded differently when loaded. One is encoded as windows-1251, and another as UTF-8 - but both are decoded as US-ASCII!
We've got at least two bugs here. One is in WebKit, and is responsible for the two variants being displayed differently - the presence of a "#" character in the URL makes encodeRelativeString() assume that we have a fragment, and encode it differently, which is incorrect for data: URLs. Another bug is that we use an US-ASCII codec for decoding a response - it may be seen as a CFNetwork bug that it gives us wrong information about response encoding.
Workaround: add an explicit charset to the MIME type, AND percent-escape the hash symbol: <object class="obj" type="image/svg+xml" height="600px" data="data:image/svg+xml;charset=utf-8, <svg xmlns='http://www.w3.org/2000/svg'> <text font-weight='bold' x='-500' y='145' font-size='35px' transform='rotate(-90)'> <tspan x='-500' dy='-40' fill='%23FED062'>foo</tspan> </text> </svg>">
Created attachment 20378 [details] Fix a WebKit part of the problem This fixes the treatment of "#" character, but one will still need to explicitly declare the charset. Filed <rdar://problem/5845875> for that.
Comment on attachment 20378 [details] Fix a WebKit part of the problem r=me
Committed revision 33578. As mentioned above, part of the bug is not in WebKit, and will be tracked by Apple internally.