Linly wrote:

[(search sort=lastmodified count=20 fmt="* [[{+p}|+]] [{+p1}]")]

The "{+p}" part output correct utf-8 characters, but the "{+p1}" part
outputs %-encoding.

I know now how to fix this. first, the  [[{+p}|+]] part of fmt=
renders fine because of the +, which is asking for the title, which in
BOLTvarCache gets correctly renderd via
        foreach($BOLTvar[$page] as $field=>$value) {
                $BOLTvar[$page][$field] = BOLTurl2utf($value);
                }

{+p1} and other {+p..} do not get that in function BOLTdisplayFmt().

So to fix this i changed in function BOLTdisplayFmt() the foreach loop
to include  a call to BOLTurl2utf:

        foreach((array)$outarray as $item) {
                $item = trim($item);
                if ($item === '') continue;
                $fmt2 = $fmt;
                $p = explode('.', $item);
                $fmt2 = str_replace('{+p0}', count($p), $fmt2);
                $fmt2 = str_replace('{+p}', $item, $fmt2);
                foreach ($p as $i => $ii) {
                        $check = '{+p' . ($i + 1) . '}';
                        $iii = BOLTurl2utf($ii);
                        $fmt2 = str_replace('{+p' . ($i + 1) . '}', $iii, 
$fmt2);
                        }
                $fmt2 = preg_replace('/\{\+p[0-9]{1}\}/', '', $fmt2);
                $out .= $fmt2 . $join;
                }

This worked. then i went a step further, and changed all instances of
'BOLTurl2utf' to 'urldecode', and that is working too. Do we need a
function BOLTurl2utf() at all?

Now i am looking at the opposite: BOLTutf2url(). This is a little more
difficult it seems.
I got  a question: why is there a config option of utfpages =  true or
false ? Do we need it?

Cheers,
~Hans

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" 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/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to