1

I noticed that all my images with ü,ä,ö are not working on my production server. Serving locally with nodemon + browersync works fine.

What settings do I have to make to get my images displayed.

I use utf-8 in my HTML head

<!doctype html>
<html class="no-js" ng-app="recipes">
  <head>
    <meta charset="utf-8">

I guess I don't have to make any settings in my mongodb: How do I configure my MongoDB to take UTF-8 into account?

So then I guess only the express server ("express": "^4.12.0",) needs some extra config?

The image is on the server with the name:

niveskocht-71-grüne-speckbohnen-auf-mandel-pak-choi.jpg

And my chrome console shows me as path:

http://my-website/assets/images/niveskocht-71-gr%C3%BCne-speckbohnen-auf-mandel-pak-choi.jpg

I get a 404 when trying to load the image.

EDIT: I added this to my server.coffee:

app.use((req, res, next) ->
  res.charset = "utf-8";
  console.log parseurl(req).pathname
  if (parseurl(req).pathname.indexOf('login') != -1 || req.session.userType)
    next()

according to this: Node.js public static folder to serve js with utf-8 charset

And I get a utf-8 header: enter image description here

That is how it looks on my localhost: enter image description here

Community
  • 1
  • 1
Andi Giga
  • 3,744
  • 9
  • 38
  • 68

1 Answers1

0

Its a pure guess but I think it is related to, that there are diff. types or encodings of umlauts. I now just renamed all my scraped images with gulp. But this looked like it is causing a problem:

enter image description here

enter image description here

Andi Giga
  • 3,744
  • 9
  • 38
  • 68