Freeradius Name field utf-8 support

  • Hello,

    I did some simple changes on freeradius.xml  gui like adding a new field called "Name" ($varuserfirstname) for First name and Last name of the user and it's working but I need to save UTF-8 characters on the name field but it do not submit and save the utf-8 (Arabic) characters. and it goes blank.

    I read this
    and tried to do some changes with utf8_encode in, I added ($varuserfirstname = utf8_encode($users['varuserfirstname']);) but still no hope.

    Is there any idea on how can I fix this issue and what file to look for.


  • I imported the config with utf8 text in config.xml (the freeradius account part) and restarted the box to see how it call the accounts in the frontend, after the boot up i get this error in the console:

    Fatal error: cannot create reference to/from string offsets nor overloaded objects in /etc/inc/ on line 69

    pfsense can't retrieve utf8 in xml so this is lines 60-70 on

    function startElement($parser, $name, $attrs) {
    global $parsedcfg, $depth, $curpath, $havedata, $listtags;

    array_push($curpath, strtolower($name));

    $ptr =& $parsedcfg;
    foreach ($curpath as $path) {
    $ptr =& $ptr[$path];

    there is already a strtolower function, we need to implement a utf8 encoder too.

  • woohoo! :) I changed at line 65 and it working!

    line 65: file

    array_push($curpath, strtolower($name));

    array_push($curpath, utf8_encode(strtolower($name)));

Log in to reply