that's probably fine. Could you add a test (probably to the DOI translator)
so we catch it if it fails?


On Tue, Mar 11, 2014 at 10:06 PM, Aurimas Vinckevicius <
notifications@github.com> wrote:

> In CrossRef.js:
>
> > @@ -283,6 +283,16 @@ function processCrossRef(xmlOutput) {
> >  	}
> >  	//Zotero.debug(JSON.stringify(item, null, 4));
> >  	
> > +	//check if there are potential issues with character encoding and try to fix it
> > +	//e.g. 10.1057/9780230391116.0016 (en dash in title is presented as <control><control>â)
> > +	for(var field in item) {
> > +		if(typeof item[field] != 'string') continue;
> > +		//check for control characters that should never be in strings from CrossRef
> > +		if(/[\u007F-\u009F]/.test(item[field])) {
> > +			item[field] = decodeURIComponent(escape(item[field]));
>
> hmm, yes, would be a shame if this started breaking and I'd be happy to
> use something else, but this is the only way I know of to transcode
> strings. There might be something specific to Firefox, but I haven't found
> it yet. I'll keep looking.
>
> I think most browsers support this and probably will for a while. We could
> revert it if we start seeing this fail.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/zotero/translators/pull/694/files#r10504939>
> .
>



-- 
Sebastian Karcher
Ph.D. Candidate
Department of Political Science
Northwestern University