Skip to content

Commit e24cc83

Browse files
committed
new boolean property ParseUTF8 in JsonToCursor() method.
1 parent d64792f commit e24cc83

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

Diff for: JSONFox.PJT

462 Bytes
Binary file not shown.

Diff for: JSONFox.pjx

0 Bytes
Binary file not shown.

Diff for: jsonfox.app

221 Bytes
Binary file not shown.

Diff for: src/cursortoarray.prg

+18-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,27 @@
22
define class CursorToArray as session
33
nSessionID = 0
44
CurName = ""
5+
&& IRODG 07/10/2023 Inicio
6+
ParseUTF8 = .f.
7+
&& IRODG 07/10/2023 Fin
58
* Function CursorToArray
69
function CursorToArray as memo
710
if !empty(this.nSessionID)
811
set datasession to this.nSessionID
912
endif
1013
private JSONUtils
1114
JSONUtils = _screen.JSONUtils
12-
local lcOutput as memo, i as Integer
15+
local lcOutput as memo, ;
16+
i as Integer, ;
17+
lcValue as Variant, ;
18+
llCentury as Boolean, ;
19+
llDeleted as Boolean, ;
20+
lcDateAct as string, ;
21+
nCounter as Integer, ;
22+
lnTotField as Integer, ;
23+
lnTotal as Integer, ;
24+
lnRecNo as Integer
25+
1326
lcOutput = "["
1427
llCentury = set("Century") == "OFF"
1528
llDeleted = set("Deleted") == "OFF"
@@ -57,7 +70,10 @@ define class CursorToArray as session
5770
Otherwise
5871
&& IRODG 08/08/2023 Inicio
5972
*lcValue = JSONUtils.GetString(alltrim(lcValue))
60-
lcValue = JSONUtils.GetString(lcValue)
73+
&& IRODG 07/10/2023 Inicio
74+
*!* lcValue = JSONUtils.GetString(lcValue)
75+
lcValue = JSONUtils.GetString(lcValue, this.ParseUTF8)
76+
&& IRODG 07/10/2023 Fin
6177
&& IRODG 08/08/2023 Fin
6278
endcase
6379
&& IRODG 08/08/2023 Inicio

Diff for: src/jsonclass.prg

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ define class JSONClass as session
44
LastErrorText = ""
55
lError = .f.
66
lShowErrors = .t.
7-
version = "9.16"
7+
version = "9.17"
88
hidden lInternal
99
hidden lTablePrompt
1010
Dimension aCustomArray[1]
@@ -244,7 +244,7 @@ define class JSONClass as session
244244
endfunc
245245
* CursorToJSON
246246
function CursorToJSON as memo
247-
lparameters tcCursor as string, tbCurrentRow as Boolean, tnDataSession as integer, tlJustArray as Boolean
247+
lparameters tcCursor as string, tbCurrentRow as Boolean, tnDataSession as integer, tlJustArray as Boolean, tlParseUTF8 as Boolean
248248
local lcJsonXML as memo, loParser, lcCursor
249249
lcJsonXML = ''
250250
lcCursor = SYS(2015)
@@ -262,6 +262,9 @@ define class JSONClass as session
262262
loParser = createobject("CursorToArray")
263263
loParser.CurName = lcCursor
264264
loParser.nSessionID = tnDataSession
265+
&& IRODG 07/10/2023 Inicio
266+
loParser.ParseUTF8 = tlParseUTF8
267+
&& IRODG 07/10/2023 Fin
265268
lcJsonXML = loParser.CursorToArray()
266269
catch to loEx
267270
this.ShowExceptionError(loEx)

0 commit comments

Comments
 (0)