Subject Re: xb2net using json.
From Guillermo <> <Guillermo <>>
Date Fri, 04 Oct 2019 21:58:13 +0100
Newsgroups xb2net

Thanks Andreas
Unfortunately, I am working with xbase Version 1.90.355 and xb2net 3.6.01
According to your help, try using xbCPConvert function provided by xb2net, but it didn't work

With this code:
cString: = oCustomer: GetVar ("name")
? "Customer before", cString
cString: = xbCPConvert (cString, CP_UTF8, CP_ACP)
? "Client After", cString

Any other idea ??

Thank you



Andreas Gehrs-Pahl Wrote:

> Guillermo,
>
> >when he should receive Andrés, I receive: Andr\u00e9s
>
> You can use the Xbase++ function JsonDecode(cString). The UTF-8 "\u00e9"
> character will be decoded as an OEM or ANSI character, depending on your
> Character Set setting.
>
> You can also use the Xbase++ function Json2Var() for more complex JSON data.
>
> The Json*() functions were added to Xbase++ in Version 2.00.951.
>
> Additionally, Xb2Net also has the xbJSON class and xbJSONParse() function
> (since Version 3.6.00), but I'm not sure if they (automatically) handle
> those "\uXXXX" encodings. I would assume that they do, but I'm not sure.
>
> Finally, there are some other options, like Chilkat and OT4Xb, which also
> have JSON handling and encoding/decoding functionality.
>
> Hope that helps,
>
> Andreas
> --
> Andreas Gehrs-Pahl
> Absolute Software, LLC
>
> phone: (989) 723-9927
> email: Andreas@AbsoluteSoftwareLLC.com
> web:   http://www.AbsoluteSoftwareLLC.com
> [F]:   https://www.facebook.com/AbsoluteSoftwareLLC


Recent messages in this thread
 
-# xb2net using json. Guillermo <> 28-Sep-2019 04:10 pm
.-# Re: xb2net using json. Andreas Gehrs-Pahl 28-Sep-2019 06:01 pm
..-# Re: xb2net using json. (Current message) Guillermo <> 04-Oct-2019 04:58 pm
...\# Re: xb2net using json. Andreas Gehrs-Pahl 05-Oct-2019 08:11 pm