Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
0d543126
Commit
0d543126
authored
12 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash in converting JSON string that included non-ASCII characters. Now assume UTF-8
SVN: 27458
parent
de2e85bf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis-ipad/BisKit/Classes/CISDOBIpadEntity.m
+9
-3
9 additions, 3 deletions
openbis-ipad/BisKit/Classes/CISDOBIpadEntity.m
with
9 additions
and
3 deletions
openbis-ipad/BisKit/Classes/CISDOBIpadEntity.m
+
9
−
3
View file @
0d543126
...
@@ -25,11 +25,17 @@
...
@@ -25,11 +25,17 @@
#
import
"CISDOBIpadService.h"
#
import
"CISDOBIpadService.h"
///
!
Convert
a
JSON
string
to
objects
.
Returns
nil
if
the
string
is
nil
.
///
!
Convert
a
JSON
string
to
objects
.
Returns
nil
if
the
string
is
nil
.
id
ObjectFromJsonData
(
NSString
*
jsonData
,
NSError
**
error
)
id
ObjectFromJsonData
(
NSString
*
jsonData
String
,
NSError
**
error
)
{
{
if
(
nil
==
jsonData
)
return
nil
;
if
(
nil
==
jsonDataString
)
return
nil
;
NSData
*
jsonData
=
[
jsonDataString
dataUsingEncoding
:
NSUTF8StringEncoding
];
if
(
!
jsonData
)
{
NSLog
(
@
"Could not convert json string (%@) to UTF-8"
,
jsonDataString
);
//
Do
not
treat
this
as
an
error
--
just
log
it
return
nil
;
}
return
[
NSJSONSerialization
JSONObjectWithData
:
[
jsonData
dataUsingEncoding
:
NSASCIIStringEncoding
]
options
:
0
error
:
error
];
return
[
NSJSONSerialization
JSONObjectWithData
:
jsonData
options
:
0
error
:
error
];
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment