Page 1 of 1

Problem Saving Text.php In UTF-8 Encoding

Posted: Sat Jan 29, 2011 1:46 pm
by flipfloprs
Script URL:
Version of script: 2.2
Hosting company: fanaa.ir
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
I have a problem in translating HESK to Persian language. after translation i have to save the file in UTF-8 encoding becouse the persian characters are not supported in ANSII. and after this I will have a problem in navigating between pages. for example:
1-after submiting a new ticket, user will stay in the same page and wouldn't redirected to a new page with normal message.
2-admin enters into administrator panel but after typing username and password and clicking on login button, this page will be loaded:http://support.fanaa.ir/admin/index.php
instead of this one: http://support.fanaa.ir/admin/admin_main.php

username:administrator
password:admin

Re: Problem Saving Text.php In UTF-8 Encoding

Posted: Sat Jan 29, 2011 9:56 pm
by Klemen
The problem with saving files in UTF-8 format is that this format ads some extra bytes to the start of the file and these break the HTTP headers sent out by the script. In return some things that depend on HTTP headers (like sessions and redirects) don't work properly. Those extra bytes are not visible in most programs.

I would recommend NOT saving files in UTF-/, but if you do you can *probably* fix the problem by opening the language file in this program (Notepad++):
http://notepad-plus-plus.org/

You should see some special chars at the start of your language file, before the <?php
Deleting those chars might solve your issue.

Alternatively you should be able to see the extra UTF-8 bytes in a hex editor:
http://www.google.com/search?q=free+hesk+editor

Re: Problem Saving Text.php In UTF-8 Encoding

Posted: Sun Jan 30, 2011 7:12 am
by flipfloprs
Thanks, it worked.

Re: Problem Saving Text.php In UTF-8 Encoding

Posted: Sat Feb 12, 2011 12:01 pm
by flipfloprs
This solution works for most of my problems but one of the major forms do not work properly yet. I have opened the language file in Notepad plus plus but their was not any additional characters so I just saved the file in UTF-8 without BOM (I have no idea what is it) and then, when I want to create a new ticket, it works but I have a speed problem. It takes more than 1 or 2 minute to show me my ticket tracking number and during this time the user can click on the submit button again and again.

Re: Problem Saving Text.php In UTF-8 Encoding

Posted: Wed Feb 16, 2011 1:02 pm
by Klemen
"bom" (byte order mark) is what is causing problems to most people saving it in UTF-8 (the bytes at the start of the file that don't show up in most editors).

If submitting a ticket takes very long it is probably due to the mail() function (your server is very slow in sending out mail) and it a server rather than a script issue. To confirm this you can delete all lines that start with

Code: Select all

@mail
from the submit_ticket.php file. It should submit a ticket quickly then, but no e-mails will be sent.