通过API发送带有阿拉伯字符的查询时出现问题

时间:2019-07-05 09:13:55

标签: api arabic quickbooks-online cs-cart

我无法通过API发送带有阿拉伯字符的查询。我正在尝试将查询从CS-Cart发送到Quickbooks Online。

我尝试使用以下阿拉伯字母发送查询:

select * from Customer Where DisplayName = 'احمد عبدالعزيز'

它返回:

{
 "responseHeader": {
  "status": 400,
  "message": "Bad Request",
  "intuitTid": "2dbec1fd-5dc1-3a14-4a12-7c338db0ee2a",
  "realmID": "123146420719144"
 },
 "response": {
  "Fault": {
   "Error": [
    {
     "Message": "Error parsing query",
     "Detail": "QueryParserError: Invalid content. Lexical error at line 1, column 45.  Encountered: \"\\u0627\" (1575), after : \"\\'\"",
     "code": "4000"
    }
   ],
   "type": "ValidationFault"
  },
  "time": "2019-07-04T07:09:03.026-07:00"
 }
}

如果我在对名称进行编码后尝试使用它,并按以下方式发送查询:

select * from Customer Where DisplayName = '%D8%A7%D8%AD%D9%85%D8%AF+%D8%B9%D8%A8%D8%AF%D8%A7%D9%84%D8%B9%D8%B2%D9%8A%D8%B2'

它什么也不返回:

{
 "QueryResponse": {},
 "time": "2019-07-04T07:09:42.698-07:00"
}

我希望像这样

{
 "QueryResponse": {
  "Customer": [
   {
    "Taxable": false,
    "BillAddr": {
     "Id": "924",
     "Country": "Saudi Arabia"
    },
    "ShipAddr": {
     "Id": "925",
     "Country": "Saudi Arabia"
    },
    "Job": false,
    "BillWithParent": false,
    "Balance": 157.5,
    "BalanceWithJobs": 157.5,
    "CurrencyRef": {
     "value": "SAR",
     "name": "Saudi Riyal"
    },
    "PreferredDeliveryMethod": "None",
    "IsProject": false,
    "domain": "QBO",
    "sparse": false,
    "Id": "577",
    "SyncToken": "0",
    "MetaData": {
     "CreateTime": "2019-07-01T06:37:32-07:00",
     "LastUpdatedTime": "2019-07-01T06:37:33-07:00"
    },
    "GivenName": "Ramil",
    "FamilyName": "Gilaev",
    "FullyQualifiedName": "Ramil Gilaev",
    "DisplayName": "Ramil Gilaev",
    "PrintOnCheckName": "Ramil Gilaev",
    "Active": true,
    "PrimaryPhone": {
     "FreeFormNumber": "123456789"
    }
   }
  ],
  "startPosition": 1,
  "maxResults": 1
 },
 "time": "2019-07-05T02:12:35.562-07:00"
}

我也注意到即使查询是英文名称,其结果也相同。

select * from Customer Where DisplayName = 'Ahmed Al-Khuraisir'

结果:

{
 "QueryResponse": {},
 "time": "2019-07-05T03:31:11.149-07:00"
}

请检查附件中的图像。

Screenshot 1

Screenshot 2

0 个答案:

没有答案