Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Strange characters at start of output file

Author  Topic 

Huligan
Yak Posting Veteran

66 Posts

Posted - 2006-05-15 : 15:06:46
Hello. I have created a SQL job that produces a RSS XML file daily. The job calls a stored proc which pulls some records from a few tables with joins, the XML tags are inserted into the SELECT statement, and the records flow into the middle of an XML document that serves as a template. Here's what the beginning of my template file looks like.

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
etc.

Here's what the beginning of the output file looks like.

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
etc.

I can not seem to find out why the "" is being inserted. It only does it when I use a template. I have reduced the template's contents so it only has the insert tags and it still does it. Here the code I use in my job.

EXECUTE sp_makewebtask
@outputfile = N'M:\rss\output.xml',
@query=N'EXECUTE [sp_RSS_Output]',
@templatefile=N'M:\rss\output_template.xml'

This is (hopefully) the final hurdle in getting this RSS feed working. I would appreciate any suggestions. Thanks for your time.

Les

Huligan
Yak Posting Veteran

66 Posts

Posted - 2006-05-15 : 15:14:05
I forgot to add that I was not having this problem on my development SQL Server. This issue only exists on the live production SQL Server. I checked and both SQL Servers are the same version. Any ideas why?

Les
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2006-05-16 : 03:59:50
I can't tell you why it's appearing, but I can tell you what it is.
It's a UTF-8 BOM being interpreted as 3 ISO Latin 1 (or CP1252) characters. Either the output file isn't really UTF-8 encoded or what you're reading it with doesn't understand UTF-8.
The byte order mark is optional at the start of a UTF-8 stream, so it's possible that the process is introducing it.

Background information:
http://www.unicode.org/faq/utf_bom.html#BOM
Go to Top of Page
   

- Advertisement -