0

EDIT 1: I have created a new laravel project just blank one and diacritics also doesn't work, meta char is included.

Html code:

 <div class="row">
    @foreach ($TagNames as $TagName)
        <div  class="col-sm-4">
            <p>{{$TagName->TagName}}</p>
            <img style="min-width:35%; min-height:35%"; class="img-responsive"; src="images/{{$TagName->TagName}}.jpg"> 
        </div>
    @endforeach
      </div>

Everything works fine for getting images until the path name has some diacritics (romanian ones î,â,ț,ă,ș), I tried adding

<img style="min-width:35%; min-height:35%"; class="img-responsive"; src="images/Dude1withî.jpg">

and it doesn't work too.

<meta charset="utf-8">

Is added but doesn't do anything.

Examples of images stored in images folder:

Măr.png, Pîine.png, Pastă.png and so on 

How can I solve this? Any given help will be greatly appreciated.

Community
  • 1
  • 1
DomainFlag
  • 563
  • 2
  • 9
  • 22
  • Where is the problem? Is it with php outputting the correct name, The browser not able to deal with the special chars, or is the webserver having a problem with the request? There are many points of failure here. – Jason K Jul 25 '16 at 18:16
  • Inspected the page gives the normal path with diacritics, but It doesn't retrieve the image – DomainFlag Jul 25 '16 at 18:20
  • I tried without php outputting, like so src="images/Dude1withî.jpg" with (î), and doesn't work too – DomainFlag Jul 25 '16 at 18:21
  • I am using localhost, the images are stored in laravelproject/public/images/, normal images without diacritics works, idk – DomainFlag Jul 25 '16 at 18:22
  • 2
    Can you put the img path in the browser address bar directly? Also check the webserer error log. – Jason K Jul 25 '16 at 18:24
  • I tried putting it manually, doesn't work too although for names without diacritics works, webserver error log how to do it? – DomainFlag Jul 25 '16 at 18:32
  • For iis http://stackoverflow.com/a/6426399/4178487 or for Apache /var/log/apache2/error.log – Jason K Jul 25 '16 at 18:40
  • use url('images/'.{{$TagName->TagName}}.'.jpg') helper function to get the full correct one. – ClearBoth Jul 25 '16 at 21:38

1 Answers1

0

If your images directory is placed in laravel root update the code below with asset() function. Try,

<img style="min-width:35%; min-height:35%"; class="img-responsive"; src="{{ asset('images/Dude1withî.jpg') }}" />

Will work. Thanks.

Glen Pinheiro
  • 216
  • 2
  • 12