- Posts: 30
- Thank you received: 0
utf 8 to latin
How to solve this problem?
Please Log in or Create an account to join the conversation.
$encodingHelper = hikashop_get('helper.encoding');
$latin_text = $encodingHelper->change($utf8_text,'UTF-8','ISO-8859-1');
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
a- Could you explain why developer need to handle /manage utf-8 function in joomla or Hikashop extension or php ?
OS , http server , SQL database , programming language files should in 2014 all be compatible ( configure ) with utf-8 ? .
Windows OS from Microsoft don't support real utf -8 .
b- Does the helper function is document somwhere in hikashop website ?
c- python choose by default the encoding of the OS so since i use windows 8.1 64 bits i have for python
for getdefaultencoding => 'ascii'
for getdefaultlocale() => ('fr_FR','cp1252')
no standart in 2014 beetween OS .Internet try to create standart by force browser to follow standart !!
Regard's
Please Log in or Create an account to join the conversation.
1. Windows supports UTF8. Why do you think it doesn't ?
You need to handle UTF8 because old software are not always compatible with it. Old email servers for example, or old payment gateways.
2. No. That's a function specific to HikaShop internals and should not have to be used for third party developers since everything should use UTF8. And if you need to use encoding conversions, PHP has functions for that (iconv, utt8_encode, etc) which are actually what is done by our helper.
3. I would recommend to tell that to python developers. They probably have a good reason for that. PHP uses UTF8 by default since PHP5.0 I think.
Please Log in or Create an account to join the conversation.
FirstName = '????'
LastName = '???????????'
PostalCode = '1000'
Address = '????? ?????? ?? 7-2/12'
City = '??????'
Country = 'Macedonia'
way give me ? when post with cyrilic?
I try with $FirstName = $encodingHelper->change($utf8_text,'UTF-8','ISO-8859-1'); but nothing.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Which payment plugin are talking about ?
Are you sure that the text is in UTF-8 and can be convert into ISO-8859-1 ?
Are you sure the other payment platform is supporting the ISO-8859-1 format ?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
from banks system send me log with FirstName='????'
FirstName='коки'
length of the field FirstName 008
What does your application field of 4 characters calculated length 8
Please Log in or Create an account to join the conversation.
cpay.com.mk
Please Log in or Create an account to join the conversation.
I am sorry but "коки" can't be converted into ISO-8859-1.
It is just not possible.
You can try it youself:
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
all data value send to the system must to be utf8 encoding
Please Log in or Create an account to join the conversation.
FATAL param[FirstName].Length=4 , given length in CheckSumHeader =8 this is because before get lengt for field i must to encod to the UTF8 with utf8_decode(field)you think problem will be solved?
Please Log in or Create an account to join the conversation.
So, I am sorry but the problem comes from your plugin.
The data is already in UTF8 and you can simply use the "strlen" function to get the string length of a UTF8 string.
I don't know how your plugin works and what it has to do but if you don't need to convert the UTF8 to latin, you just have to use it.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
$PayToMerchant = $method->payment_params->merchantid;
$MerchantName = 'XXXX';.......etc for $AmountCurrency ,$Details1 ,$Details2
next
$zero = '0';
$password = 'XXXXX';
//$password = $method->payment_params->encriptionkey;
$len_AmountToPay = strlen($AmountToPay);
$len_PayToMerchant = strlen($PayToMerchant);
$len_MerchantName = strlen($MerchantName); etc
next
if ($len_AmountToPay<10) {
$nula_AmountToPay = '0';
}
else {
$nula_AmountToPay = '';
}
next
$parameters_value = $zero.$nula_AmountToPay.$len_AmountToPay.$zero.$nula_PayToMerchant.$len_PayToMerchant.$.....etc
$CheckSumHeader = '16AmountToPay,PayToMerchant,MerchantName,....etc'.$parameters_value;
$CheckSum = $CheckSumHeader.$AmountToPay.$PayToMerchant.$MerchantName.$AmountCurrency.$Details1.$Details2.etc;
$CheckSum_control = md5($CheckSum);
<form id="hikashop_casys_form" name="hikashop_casys_form" action="<?php echo $gateway_url?>" method="post" >
<input id='AmountToPay' name='AmountToPay' value='<?php echo $AmountToPay; ?>' type='hidden' />
..... etc other input.
FATAL param[FirstName].Length=4 , given length in CheckSumHeader =8 this is because before get lengt for field i must to encod to the UTF8 with utf8_decode(field)you think problem will be solved?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Like Nicolas said, the problem is in your payment gateway API, not in HikaShop.the checksum is not correct based on your payment gateway API
Your problem is not related to HikaShop or his encoding, so please contact your payment gateway support and see with them own to solve this problem.
But we can't do anything for you because it is not an HikaShop problem.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.