Comments (4)
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.
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.
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.
Might be added if there's a higher demand, closing this for now.
from php-integration.
Related Issues (20)
- [Feature Request] Universal examples regardless of browser or CLI HOT 1
- Problem with response
- Creation of dynamic property is deprecated HOT 1
- Updates needed for PHP 8.2 HOT 4
- Is there any change in the WSDL url for invoices HOT 3
- Critical: WebService changes effective 1 oct needs immediate implementation!
- Retrieving status for an order HOT 2
- How to validate if order was approved with Bank ID or not?
- Enable logging for payment plans gives fatal error
- Warning: Undefined property CreateOrderBuilder::$identificationRejectionUrl HOT 1
- How to query the order when using checkout orders HOT 5
- Order not found after checkout finish HOT 1
- How to make a delivery of a checkout order HOT 3
- Update the ClientOrderNumber after checkout HOT 1
- Fatal error: Uncaught Error: Undefined class constant 'DBNORDEAFI' HOT 2
- Error: 308 (BAD_PAYMENTMETHOD) HOT 5
- [Feature Request] Save log to file
- [Feature Request] Grab the raw HTTP log for SOAP as well
- Isn't it a security risk to disable SSL peer validations?
- GetAddresses is deprecated and has been replaced by GetAddressesEu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-integration.