Modify

Opened 9 years ago

Closed 9 years ago

#1071 closed Bug/Fehler (fixed)

Klarna Funktion KITT_String::decode() problematisch bei UTF-8 Shops

Reported by: Torsten Riemer Owned by: somebody
Priority: hoch Milestone: modified-shop-2.0.2.0
Component: Shop Version: 2.0.0.0
Keywords: Cc:
Blocked By: Blocking:

Description

Die Funktion KITT_String::decode() in "/includes/external/klarna/KITT/String.php" wird teilweise so angewandt, dass von UTF-8 nach ISO-8859-15 konvertiert wird.

Funktion:

    /**
     * Decode the string to the platformEncoding
     *
     * @param string $str  string to decode
     * @param string $from from encoding
     * @param string $to   target encoding
     *
     * @return string
     */
    public static function decode($str, $from = null, $to = null)
    {
        if ($from === null) {
            $from = self::$klarnaEncoding;
        }
        if ($to === null) {
            $to = self::$platformEncoding;
        }
        return iconv($from, $to, $str);
    }

Vorkommen:
"/includes/external/klarna/class.KlarnaBase.php"

        return array(
            'id' => $this->code,
            'module' => KITT_String::decode($view->getTitle(), "UTF-8", "ISO-8859-15"),
            'module_cost' => $view->getExtra(),
            'fields' => array(
                array(
                    'title' => $script.$css,
                    'field' => $view->show()
                )
            )
        );

"/includes/modules/order_total/ot_klarna_fee.php"

        $this->output[] = array(
            'title' => $this->title . ':',
            'text' => KITT_String::decode(
                $formatter->formatPrice(
                    $od_amount, KiTT::locale($this->_country)
                ),
                "UTF-8",
                "ISO-8859-15"
            ),
            'value' => $od_amount
        );

Das sorgt dafür, dass in UTF-8 Shops das Eurozeichen bei der Klarna-Gebühr bei der Auswahl der Zahlarten als � angezeigt wird.

Wieso verwenden wir hier nicht einfach unsere Funktion decode_utf8(), die die Kodierung vorher überprüft?

Alternativ können wir die Funktion KITT_String::decode() auch mit dem Inhalt unserer Funktion ersetzen.

Attachments (0)

Change History (1)

comment:1 by Gerhard Waldemair, 9 years ago

Resolution: fixed
Status: newclosed

In 10460:

fix #1071

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.