# How do I convert MathML characters to XML in texmath? [closed]

I'm in the process of converting LaTeX to MathML in PHP. texmath is the command line tool through which the conversion process can be done.

Latex file:

\mathbf{f} = (f_{1},
f_{2})^{\prime}


test.php:

shell_exec('echo "password" | sudo -S /root/.cabal/bin/texmath latexfile > outputfile');


If I run this PHP file through the command line, it generates the desired output file which is below.

Command line: php test.php

 <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mstyle mathvariant="bold">
<mi>𝐟</mi>
</mstyle>
<mo>=</mo>
<mo stretchy="false" form="prefix">(</mo>
<msub>
<mi>f</mi>
<mn>1</mn>
</msub>
<mo>,</mo>
<msub>
<mi>f</mi>
<mn>2</mn>
</msub>
<msup>
<mo stretchy="false" form="postfix">)</mo>
<mo>′</mo>
</msup>
</mrow>
[/itex]


When I run this PHP file through the browser I am getting an output file like this:

<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mstyle mathvariant="bold">
<mi>


It ignores all the mathtype characters. Why is it gives desired output only through the command line but not through the browser? When I open these two files in the editor it displays 'UTF-8'. Is this a character encoding issue? How do I solve this?

U+1d41f MATHEMATICAL BOLD SMALL F