Giter VIP home page Giter VIP logo

Comments (4)

nlii avatar nlii commented on August 22, 2024

We would need more insight in what the issue is here. Where would we for example get $this->charset from? Could you elaborate the issue a little more?

from php-integration.

timint avatar timint commented on August 22, 2024

I am thinking about the regular issues with osCommerce. Where version 2.2 is iso-8859-1 by default and 2.3 is utf-8. Modules are universal to both versions but requires checking outgoing data for charset conversion. This is one of the main reasons why checkout fails in third party modules. Charsets are always a step in the progress in machine to machine communication.

Imagine if you could tell the SWP framework what charset you are passing by a simple setting as ->SetCharset('UTF-8'). This would indicate that all information that is passed to the framework is utf-8 encoded and so should the desired output/response be. If ISO-8859-1 was set all input and output from the framework to the platform would be latin1 encoded.

"Ett skepp kommer lastat - Med vadå"

My example $this->charset is just an hypothetical internal pointer inside the swp framework.

Now the opposite of this would be to encode/decode every parameter sent. This is less helpful:

->setCompanyName(utf8_encode($company))

In oscommerce 2.2 I usually build a complete xml in iso-8859-1 then recodes the complete xml string alltogether to utf8 before sending it.

from php-integration.

timint avatar timint commented on August 22, 2024

A solution to this could be that every parameter that is recceived by the internal framework from the user end is washed, cleaned, trimmed, tag stripped or whatever comes to interest, and for course transcoded.

Hypothetically:

// Input
function oneFancySveaMethod($input) {
$input = $this->inputVar($input); // Transforms input to framework friendly encoding
...
}

// Output
function anotherFancySveaMethod() {
...
return $this->outputVar($output); // Returns output to platform friendly encoding
}

function inputVar($param) {
// is this a string or an array
// do we need to wash and transcode anything?
}
function outputVar($param) {
// is this a string or an array
// do we need to transcode anything?
}

from php-integration.

fre-sund avatar fre-sund commented on August 22, 2024

Might be added if there's a higher demand, closing this for now.

from php-integration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.