Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:13:15+00:00 2026-06-04T04:13:15+00:00

A controller passes an array to a twig template. The array contains strings that

  • 0

A controller passes an array to a twig template. The array contains strings that correctly UTF-8 encoded. I can check this in the controller with var_dump($theArray). All strings are displayed correctly.

But in twig

{% for video in videos %}
   {{ video.title_value | raw }} <br>
{% endfor %}

some characters like Ö,Ä,Ü are replaced by this �. The controller and the template are encoded UTF-8 without BOM and

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

is set. I have to do the raw output because the strings may contain html tags. Any idea how to fix the �?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:13:15+00:00Added an answer on June 4, 2026 at 4:13 am

    I’m not sure that your source data is actually UTF-8 encdoded. var_dump() alone isn’t sufficient to verify the encoding of your content.

    Try echoing/dumping the content and viewing the page with Firefox or Chrome and change the encoding to UTF-8 and then something else like ISO-8859-1. If your content looks wrong when you have UTF-8 selected then your content is not UTF-8 encoded.

    • To change the encoding in Firefox: View > Character Encoding
    • To change the encoding in Chrome: Tools > Encoding
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 1 controller that passes 2 paginated set of results to a twig
I am trying to make an ajax call by passing named parameters: $this->Js->link('Save',array( 'controller'
Controller First I tried this: [HttpPost] public ActionResult Edit(JournalEntry journalentry) { if (ModelState.IsValid) {
My controller, in a nutshell is this: chart1.SeriesCollection.Add(SC); using (MemoryStream ms = chart1.GetChartStream()) {
My controller is like this @RequestMapping(value =/getTaggedProducts, method = RequestMethod.GET) @ResponseBody public String getProductsTagged(@RequestParam(questionnaireId)Long
I have a View Controller where I select some data into an array and
So we have a real-estate-related site that has controller/action pairs like homes/view, realtors/edit, and
I'm new to MVC. You have been warned... I have User model that can
A submitted form on my site returns an array of request data that is
I am trying to test a controller action that allows edition of user profiles.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.