Running TinyButStrong

Discussion about the open-source Phalanger [?] project.

Running TinyButStrong

Postby MaitreDede » May 25th, 2012, 8:24 am

Hi,

Just a word to say I am making some simple tests with the TinyutStrong framework.

The only trouble I have are the files encoding, when saved with Visual Studio. They have BOM, and TBS don't handle them.

So to detect and remove the BOM, I render the template using this piece of code :
Code: Select all
$tbs->Show(TBS_NOTHING);
$html = $tbs->Source;

$bom = chr(0xEF).chr(0xBB).chr(0xBF);
if(strlen($html) >= strlen($bom))
{
    if(substr($html, 0, strlen($bom)) == $bom)
    {
        $html = substr($html, strlen($bom));
    }
}
MaitreDede
 
Posts: 29
Joined: May 22nd, 2012, 7:17 am

Re: Running TinyButStrong

Postby Jakub Misek » May 25th, 2012, 8:35 am

You can also setup VisualStudio to not save BOM?
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Running TinyButStrong

Postby MaitreDede » May 25th, 2012, 8:58 am

I don't think. The only wayI know to save files without BOM is to "Save as..." and select encoding and BOM options. But I have to do it for each file.

I haven't found yet the magic option to do this.
MaitreDede
 
Posts: 29
Joined: May 22nd, 2012, 7:17 am


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 12 guests

User Control Panel

Login

Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 guests (based on users active over the past 5 minutes)
Most users ever online was 787 on May 12th, 2024, 11:50 am

Users browsing this forum: No registered users and 12 guests