fix input according to locale rather perlio default #667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If logs contains UTF-8 characters JSON output embeds "badly converted" characters :
This patch produces a correct query output with the given locale (locale should be adapted to input file locale) :
I didn't made extended tests on other output formats though it would be useful to be sure there won't be any regression.
Here are the simple tests I've made :
and outputs
It's quite basic (rough) but it shows up "Wide Character in print" warnings :
I'd like to get rid of such warning messages though could you give me more kind guidelines to finish this PR without warning (your thoughts). If not possible I'll try to find a correct way by myself.
Please take note of tsung output with illegal division by zero on line
where
$total
seems to be zero. Others output treats it like this(+$total||1)
If this fix is correct, I'll include it in another PR.
Thanks for creating pgbadger, it's an everyday friend for me !