Domanda

I'm developing a Zend application. It caches menu items to reduce database transactions. I'm looking for a way to set encoding of cached files to UTF8. In application.ini I have:

resources.view.encoding = "UTF-8"

Though seems not working.

Update:

I can't find _initCache function or any other code responsible of caching. Caching is only specified in application.ini :

resources.cache.frontEnd = core
resources.cache.backEnd = file
resources.cache.frontEndOptions.lifetime = 1200
resources.cache.frontEndOptions.automatic_serialization = true
resources.cache.backEndOptions.lifetime = 3600
resources.cache.backEndOptions.cache_dir = APPLICATION_PATH "/../cache"
pluginPaths.CMS_Application_Resource   = APPLICATION_PATH "/../library/CMS/Application/Resource" 
È stato utile?

Soluzione

I'm looking for a way to set encoding of cached files to UTF8

Zend_Cache doesn't have an encoding option and doesn't handle encodings! Zend_Cache simply stores data as a binary stream so if you store UTF-8 text you store a byte stream and if you store ASCII text you store a byte stream. YOU have to know which type of data you stored within the cache and how to use it. If you don't have magic_quote_runtime enabled you get the same bytes you stored before else disable this deprecated PHP-INI-Setting (and all other magic quotes settings).

Altri suggerimenti

In layout have this?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top