dindent icon indicating copy to clipboard operation
dindent copied to clipboard

Problème sometime with utf8 encoded string

Open eos-13 opened this issue 11 years ago • 1 comments

Some utf8 encoded string don't work after being process. In indenter.php:

replace l75

        $input = preg_replace('/\s{2,}/', ' ', $input);

with

        $input = preg_replace('/\s{2,}/u', ' ', $input);

and (l158)

        $output = preg_replace('/(<(\w+)[^>]*>)\s*(<\/\2>)/', '\\1\\3', $output);

with

        $output = preg_replace('/(<(\w+)[^>]*>)\s*(<\/\2>)/u', '\\1\\3', $output);

Solve my problem ... Maybe should be commited ?

Best regards,

eos-13 avatar Mar 19 '15 18:03 eos-13

Great tool, but I have this annoying mistake as well. eos-13's solution solves my problem as well.

Fabbio86 avatar Aug 12 '15 10:08 Fabbio86