If you're using utf-8 then you can't use chr(135) because it's not a
valid utf-8 value. The php function chr() doesn't return a character,
it returns a 1-byte character - utf-8 uses 2 bytes to encode this
character. You'd need to handle the bytes individually - chr(135)
represents unicode character U+0087, represented in utf-8 as 0xC2 0x87
(hex) - or `chr(0xC2).chr(0x87)` using chr().

If it works in plain php then it's probably the htmlspecialchars()
call that's messing it up - try using

$form->input('field', array('value' => ..., 'escape' => false));

In any case, why not use html entities directly?

$form->input('field', array('value' => '‡', 'escape' =>
false)); // hex
$form->input('field', array('value' => '‡', 'escape' =>
false)); // dec

hth
grigri

On Dec 5, 4:36 pm, Renesistemic <[EMAIL PROTECTED]> wrote:
> grigri,
>
> Thanks for the prompt reply. Unfortunately, that didn't help me. My
> core.php file already has the line
> Configure::write('App.encoding', 'UTF-8');
>
> and the MySQL tables for Cake are running a utf8_general collation...
> the MySQL table collation isn't even an issue at this point, however,
> as I'm still experiencing problems with this issue by simply coding
> the extended ASCII characters inline (see below example reprinted from
> original post)
>
> $this->Form->input($datavalue, array('value'=>chr(105).chr(110).chr
> (115).chr(130).chr(135)));
>
> What's interested is, if I just print the following: <input type=text
> value="<?php echo chr(105).chr(110).chr(115).chr(130).chr(135); ?>">,
> it outputs completely fine. It's definitely an issue with the CakePHP
> Form helper, and I initially thought it might be an encoding issue,
> but I feel like I have everything set up correctly.
>
> Am I missing something?
>
> On Dec 5, 11:22 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > If you're using UTF-8, this shouldn't be a problem - just use UTF-8
> > characters directly.
>
> > I just tried with
>
> > <?php echo $form->input('test', array('value' => '☃♠♣♥♦')); ?>
>
> > And it worked fine (that's `snowman`, `spades`, `clubs`, `hearts`,
> > `diamonds` in case the font you're using doesn't have them).
>
> > If you're not using UTF-8, then you should be!
>
> > hth
> > grigri
>
> > On Dec 5, 3:44 pm, Renesistemic <[EMAIL PROTECTED]> wrote:
>
> > > I've isolated some problems I've been having down to the CakePHP Form
> > > helper. It seems that the form helper is unable to create HTML form
> > > objects with correct values when the $form->input( ) method is called
> > > while passing in extended ASCII characters.
>
> > > For example, this code creates a text box with the value : insx}
> > > $this->Form->input($datavalue, array('value'=>chr(105).chr(110).chr
> > > (115).chr(120).chr(125)));
>
> > > This code creates a text box with a blank value:
> > > $this->Form->input($datavalue, array('value'=>chr(105).chr(110).chr
> > > (115).chr(130).chr(135)));
>
> > > The difference is the last two characters. Anytime I submit a value to
> > > the form helper with a character of over 127, the form helper fails to
> > > populate the HTML form element it creates with the value I pass in.
>
> > > Thoughts / Suggestions? Thanks!
>
> > > PS: I'm running the latest version of RC3.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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