[Rbrainz-users] REXML::ParseException: Declarations can only occur in the doctype declaration. (MusicBrainz::Webservice::ResponseError)

Philipp Wolfer phw at rubyforge.org
Fri Aug 17 10:41:16 EDT 2007

Hello Armin,

Ok, some more information:

All requests to the MB server must be UTF-8 encoded, the above example
uses latin1. This causes the trouble.

Try to save the test file with UTF-8 encoding and write "ü" instead of
"\374" or use the iconv module to convert between the encodings like

Iconv.iconv("utf-8", "iso-8859-1", "Christina St\374rmer").to_s

By the way: RBrainz will always return UTF-8 strings. If you need to
do some string processing with the results you might want to use jcode
in your application. Just include it with the following two lines and
you can safely use string operations.

require 'jcode'

Philipp Wolfer

More information about the Rbrainz-users mailing list