Just specifying UTF-8 will not work because the file is not actually
encoded as UTF-8. You'll need to convert the file(s) from whatever
character set it is to UTF-8. I suggest using iconv for that[1]. If
you cannot install it, there's an online version[2]. There's also a
GUI app available[3]. I've never used either of those though.

First, you'll need to know the code that iconv uses for your character set:

iconv --list

This will list all the codes it uses. Once you know that, you can
convert the file to UTF-8. For example, if your files are encoded with
ISIRI 3342 Farsi Charset:

iconv -f ISIRI-3342 -t UTF-8 < filename > filename.utf8

Once your files are converted, ensure that you have
Configure::write('App.encoding', 'UTF-8'); in core.php. Then set the
document's character set with $html->charset().

[1] http://www.gnu.org/software/libiconv/documentation/libiconv/iconv.1.html
[2] http://www.iconv.org/
[3] http://www.marblesoftware.com/Marble_Software/Charco.html

On Thu, Aug 13, 2009 at 2:06 AM, persianshadow<[email protected]> wrote:
>
> i found my problem but need solution !
>
> my layout and view file contain some Asian (persian) Character and i
> must save my file with UTF8 encode instead
>
> ANSI . when i save my view file with ANSI encode everything goes Right
> way and css appear in head tag and don't show
>
> unwanted white spaces but with UTF8 encoding don't ! these Characters
> are static and don't Retrieve from databse
>
> and if must my view file with UTF8 encoding for show correct
> Character . i test this solution but don't affecte :
>
> 1 - save my file with ANSI encode and add <?php echo $html->charset
> (); ?> to my layout .
>
> anybody have solution for this problem ?
>
> On Aug 13, 8:41 am, persianshadow <[email protected]> wrote:
>> i set my css link with your parameters but now don't insert css link
>> in my html document !
>>
>> only with this format : $html->css('screen'); work but with above
>> bugs .
>>
>> also cakephp don't show any Error and i confuse with this problem :(.
>>
>> On Aug 13, 1:52 am, brian <[email protected]> wrote:
>>
>> > You're not passing the param correctly. Try this:
>>
>> > echo $html->css('screen', 'stylesheet', null, false);
>>
>> > On Wed, Aug 12, 2009 at 4:30 PM, persianshadow<[email protected]> 
>> > wrote:
>>
>> > > hi brian
>>
>> > > yes ! my css links insert in body tag !
>>
>> > > now i change these :
>>
>> > > 1 - add <?php echo $scripts_for_layout; ?> to head tag
>>
>> > > 2 - and my css tags in head tag :
>>
>> > > <?php
>> > > echo $html->css('screen');
>> > > echo $html->css('custom');
>> > > ?>
>>
>> > > and i do this : $html->css('screen', $inline=false) but don't work and
>> > > css links stay in body tag.
>>
>> > > please help me for right way.
>>
>> > > On Aug 12, 7:55 pm, brian <[email protected]> wrote:
>> > >> It looks to me like a CSS issue. Newlines in the source shouldn't have
>> > >> any affect at all on how the page renders. Look at the HTML tab in
>> > >> Firebug and hover the cursor over the surrounding elements in the
>> > >> source to see the margin/padding. If you click on the tag, you can see
>> > >> the style rules on the right.
>>
>> > >> I'm sure it's entirely unrelated, but I noticed that you have CSS
>> > >> links in the body. Those should be in the head. If you are using
>> > >> HtmlHelper to set those in the view, you can pass false as the last
>> > >> param to get it to place the link in the head.
>>
>> > >> css( $path, $rel = NULL, $htmlAttributes = array ( ), $inline = true )
>>
>> > >> On Wed, Aug 12, 2009 at 11:16 AM, 
>> > >> persianshadow<[email protected]> wrote:
>>
>> > >> > hi
>>
>> > >> > i design my html code with XHtml and CSS and add to my cakephp
>> > >> > application but in html view
>>
>> > >> > i have two unwanted white space  that don't have any codes in source
>> > >> > view of html output
>>
>> > >> > view image of my page with unwanted white space :
>>
>> > >> >http://s1d4.turboimagehost.com/sp/ec096e69ec1f5ec9d0f5939bf7999847/un...
>>
>> > >> >  but i spy with firebug and in html section of firbug i found empty
>> > >> > line , see image :
>>
>> > >> >http://s1d4.turboimagehost.com/sp/4f64597bd71ebd1dd1452593873c4e60/un...
>>
>> > >> > and when i inspect in dom i see this :
>>
>> > >> >http://s1d4.turboimagehost.com/sp/419e5d0980f8b0940711832ddecd0255/un...
>>
>> > >> > yes ! replaceWholeText() function insert " \n " character in my html
>> > >> > page and this code generate in real time
>>
>> > >> > and don't part of my code , i test my cakephp application in other
>> > >> > browsers but get same problem.
>>
>> > >> > i don't use Ajax or javascript in my layout ....
>>
>> > >> > anybody have idea ?
>>
>>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to