Seldaek / php-console

PHP Debug Console
Other
529 stars 93 forks source link

non-printable chars #20

Closed staabm closed 11 years ago

staabm commented 11 years ago

lately I am testing a lot of scripts which handle data, which contains non-printable chars.

those lead to some weird output, because kumo says a string has 6 chars, but contains only 5 visible chars.

contorl-chars

I am not sure if this is something which should be handled at php-console level, but it makes debugging sometimes really hard. would be great to get a hint from php-console which tells me that there are some control-chars in the game.. (maybe they could be highlighted with css?)

Seldaek commented 11 years ago

Maybe rather handled by tweaking krumo.. the problem is that non printable chars depend on the encoding which might complicate things, but doing it only for UTF-8 or even just ASCII might be enough.

Seldaek commented 11 years ago

Ah well I guess we could actually do it generically when displaying the response and not in krumo.

staabm commented 11 years ago

yes, thought of all chars < 32 in the ASCII table (which should be compatible across all charsets).

Maybe there is some sort of selector which matches and we can just style it like e.g.

whatever-selector-will-do {
  contents: "SomeMarker",
  font-style: italic;
  font-decoration: underline;
}
staabm commented 11 years ago

added initial control-char handling... the list of chars can be defined within the JS file.

inspired by notepad++ I made it look like: control-chars

Seldaek commented 11 years ago

OK merged, I did replace a few more chars that didn't seem common (all non-whitespace ones), but we can adjust in the future if they cause problems.