Code Duplication    Length = 12-13 lines in 2 locations

code/converters/thirdparty/Services_JSON.php 2 locations

@@ 332-343 (lines=12) @@
329
                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
330
                            break;
331
332
                        case (($ord_var_c & 0xFC) == 0xF8):
333
                            // characters U-00200000 - U-03FFFFFF, mask 111110XX
334
                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
335
                            $char = pack(
336
                                'C*',
337
                                $ord_var_c,
338
                                         ord($var{$c + 1}),
339
                                         ord($var{$c + 2}),
340
                                         ord($var{$c + 3}),
341
                                         ord($var{$c + 4})
342
                            );
343
                            $c += 4;
344
                            $utf16 = $this->utf82utf16($char);
345
                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
346
                            break;
@@ 348-360 (lines=13) @@
345
                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
346
                            break;
347
348
                        case (($ord_var_c & 0xFE) == 0xFC):
349
                            // characters U-04000000 - U-7FFFFFFF, mask 1111110X
350
                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
351
                            $char = pack(
352
                                'C*',
353
                                $ord_var_c,
354
                                         ord($var{$c + 1}),
355
                                         ord($var{$c + 2}),
356
                                         ord($var{$c + 3}),
357
                                         ord($var{$c + 4}),
358
                                         ord($var{$c + 5})
359
                            );
360
                            $c += 5;
361
                            $utf16 = $this->utf82utf16($char);
362
                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
363
                            break;