Bug 324961 live bookmark is shown in UTF8 even if should be ISO-8859-1 r=vlad

Original committer: masayuki%d-toybox.com
Original revision: 1.13
Original date: 2006/04/28 23:28:43
This commit is contained in:
benjamin%smedbergs.us 2006-07-18 15:00:24 +00:00
Родитель cddf8eb130
Коммит 6b194d8ba2
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -22,6 +22,7 @@
* Contributor(s):
* Annie Sullivan <annie.sullivan@gmail.com> (modified to work with places)
* Robert Sayre <sayrer@gmail.com>
* Masayuki Nakano <masayuki@d-toybox.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -56,6 +57,7 @@
#include "rdf.h"
#include "nsUnicharUtils.h"
#include "nsInt64.h"
#include "nsStringStream.h"
#include "nsIScriptSecurityManager.h"
@ -331,8 +333,23 @@ nsLivemarkLoadListener::TryParseAsRDF ()
nsCOMPtr<nsIRDFDataSource> ds(do_CreateInstance(kRDFInMemoryDataSourceCID, &rv));
if (NS_FAILED(rv)) return rv;
rv = rdfparser->ParseString (ds, mLivemark->feedURI, mBody);
nsCOMPtr<nsIStreamListener> listener;
rv = rdfparser->ParseAsync(ds, mLivemark->feedURI, getter_AddRefs(listener));
if (NS_FAILED(rv)) return rv;
if (!listener) return NS_ERROR_FAILURE;
nsCOMPtr<nsIInputStream> stream;
rv = NS_NewCStringInputStream(getter_AddRefs(stream), mBody);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIChannel> channel;
rv = NS_NewInputStreamChannel(getter_AddRefs(channel), mLivemark->feedURI,
stream, NS_LITERAL_CSTRING("text/xml"));
if (NS_FAILED(rv)) return rv;
listener->OnStartRequest(channel, nsnull);
listener->OnDataAvailable(channel, nsnull, stream, 0, mBody.Length());
listener->OnStopRequest(channel, nsnull, NS_OK);
// Grab the (only) thing that's a channel
// We try RSS 1.0 first, then RSS 0.9, and set up the remaining