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 8877439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:28:08+00:00 2026-06-14T19:28:08+00:00

I have a problem with special characters in my symfony program, I usually save

  • 0

I have a problem with special characters in my symfony program,
I usually save my pages with UTF-8 without BOM (I use notepad++)
for exemple this page is displayed correcly :

    je suis lé
<h1>Ajouter un acteur</h1>
{% if message %}
<p>{{ message }}</p>
{% endif %}
<form action="" method="post" {{ form_enctype(form) }}>
    {{ form_widget(form) }}
    <input type="submit" />
</form>
<p><a href="{{ path('myapp_acteur_lister') }}">Retour à la liste des acteurs</a></p>

this line je suis lé is displayed well
but when I execute a controller function which return a string , this string is not displayed well :
here is the function :

public function editerAction($id = null)
{
     $message='';
     $em = $this->container->get('doctrine')->getEntityManager();
     if (isset($id)) 
     {
      // modification d'un acteur existant : on recherche ses données
      $acteur = $em->find('MyAppFilmothequeBundle:Acteur', $id);
      if (!$acteur)
      {
       $message='Aucun acteur trouvé';
      }
     }
     else 
     {
      // ajout d'un nouvel acteur
      $acteur = new Acteur();
     }
     $form = $this->container->get('form.factory')->create(new ActeurForm(), $acteur);
     $request = $this->container->get('request');
     if ($request->getMethod() == 'POST') 
     {
            $form->bindRequest($request);
     if ($form->isValid()) 
     {
      $em->persist($acteur);
      $em->flush();
      if (isset($id)) 
      {
       $message='Acteur modifié avec succès !';
      }
      else 
      {
       $message='Acteur ajouté avec succès !';
      }
     }
     }
     return $this->container->get('templating')->renderResponse(
    'MyAppFilmothequeBundle:Acteur:editer.html.twig',
     array(
     'form' => $form->createView(),
     'message' => $message,
     ));
}

here is the capture of the page :

enter image description here

how can I achieve this?

  • 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-14T19:28:10+00:00Added an answer on June 14, 2026 at 7:28 pm

    Make sure the controller php file is also saved use UTF-8.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I converted all my files to UTF-8 without BOM encoding using Notepad++. I have
I have a problem parsing a XML file which contains special characters like ,
I have a problem concerning the input of special characters. Firstly, + is considered
I have a macro that I use to replace special characters for its html
I have a problem with turkish special characters on different machines. The following code:
I have a problem with RegExp not recognizing special characters as word characters (or
I have a problem with special characters in my database. They now display correct,
I have an ANSI-encoded CSV file that contains a number of 'problem' special characters.
I have a problem with Zends headTitle command and special characters, mainly Swedish characters
I got problem with some special characters. I have defined the meta tag as

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.