Skip to content
Advertisement

HTML form with windows cyrillic button’s names doesn’t work on OSX

I installed a site locally on OSX. The site was developed under windows and have cyrillic (Windows) encoding for some string values.

I noted that some buttons with cyrillic values wouldn’t work until I change the value to english. The button looks for this, for example:

<form action="{$REQUEST_URI}" method="POST" name="addForm" id="addForm">
...
<td colspan="2" align="center"><input type="submit" name="addDo" value="Добавить" class="btn"></td>
...
</form>

and in php I get void (false) string here:

$addDo = $_POST['addDo'];
if($addDo)
...

When I change it to

 <td colspan="2" align="center"><input type="submit" name="addDo" value="Add" class="btn"></td>

It starts to work properly.

Why can this happen? The site is not my to change, therefore the question is How can I change my OSX setup to make this site works like on Windows?

P.S. This html file is fetched from php module by smarty:

$smarty->fetch('login.html');

Advertisement

Answer

I had to set my php configuration as well.
Just go to php.ini and change from

default-charset="utf-8"

to

default-charset="windows-1251"

restart the local server – and everything works now.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement