Accent and form_submit - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Accent and form_submit (/showthread.php?tid=69737) |
Accent and form_submit - G20180111 - 01-11-2018 Hi First at all, I must say that I am a newbie with Code Igniter, so may be the answer is very simple for you. If I have miss a page in this forum or the documentation, please let me know, I will read it with pleasure... my current search were unsucessful. I try to write my first code in CI and have some problem with french accent. echo form_label('Email é : ', 'emailCreateInput'); ----> display correctly the string echo form_submit('submit', htmlentities("Créer son compte")); ---> the button value is empty (<input type="submit" name="submit" value="" />) echo form_submit('submit', htmlentities("Créer son compte")); ---> the button value is "Cr&eacute;er" instead of "Créer" (<input type="submit" name="submit" value="Cr&eacute;er son compte" />) I probably miss something, but do not know what. Can you help me ? Thanks RE: Accent and form_submit - G20180111 - 01-12-2018 Hi Ok I have more information : - form_submit calls _parse_form_attributes, - _parse_form_attributes calls html_escape - html_escape calls htmlspecialchars - htmlspecialchars converts é to &eacute; which leads to the behavior May be a bug, and should call htmlentities or something like that... I hope it helps RE: Accent and form_submit - jreklund - 01-12-2018 You don't need to call htmlentities in Codeigniters own functions. It's UTF-8 safe already. echo form_submit('submit', "Créer son compte"); RE: Accent and form_submit - G20180111 - 01-12-2018 Hi Thanks, but I already tested this way : echo form_submit('submit', 'Créer son compte'); ---> <input type="submit" name="submit" value="" /> Inside CI, it uses _attributes_to_string sometimes, but form_submit uses html_escape... Have a nice day RE: Accent and form_submit - jreklund - 01-12-2018 You will need to save all your php files as UTF-8. In Notepad++: Encoding -> Convert to UTF-8. RE: Accent and form_submit - G20180111 - 01-22-2018 I am currently using Scite and had search to set it to UTF8... after few re-work on the files it works ! Thank you so much ! |