Example #1
0
 /**
  * Test that the encoding is set and returns the correct value; default UTF-8 if empty.
  */
 public function testEncoding()
 {
     $this->assertEquals(Config::encoding(), 'UTF-8');
     Config::set('app.encoding', 'UTF-16');
     $this->assertEquals(Config::encoding(), 'UTF-16');
     Config::set('app.encoding', '');
     $this->assertEquals(Config::encoding(), 'UTF-8');
 }
Example #2
0
 /**
  * {@inheritdoc}
  *
  * @uses Titon\Common\Registry
  * @uses Titon\Utility\String
  */
 public function bindDomains($domain, $catalog)
 {
     bind_textdomain_codeset($catalog, Config::encoding());
     return $this->cache([__METHOD__, $domain, $catalog], function () use($domain, $catalog) {
         $locations = G11n::registry()->current()->getMessageBundle()->getPaths();
         foreach ($locations as $location) {
             bindtextdomain($catalog, $location);
         }
         return true;
     });
 }