Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can bring images from the web using the Import command like this:


good image

Sometimes the web request is more complicated so I must to use URLFetch. For that, this is what I have tried to do:


unreadable image

Do you know how to make the image load correctly? I suspect that this is related to strings encodings, but I have not been able to solve it.

share|improve this question
+1 for the example image – SEngstrom May 13 '13 at 22:02
up vote 8 down vote accepted

This is a bug due to the fact that URLFetch is dealing incorrectly with line breaks. Here's a workaround:

in1 = URLFetch[

You can compare this technique to the other as follows:

in2 = ToCharacterCode[URLFetch[
SequenceAlignment[in1, in2]
share|improve this answer
Thank you for your answer! – Gustavo Delfino May 14 '13 at 9:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.