Open ynnob opened 2 months ago
This is likely because of the default codepage on your OS, since it is set to German. Have you tried the solution mentioned here to override it?
This is likely because of the default codepage on your OS, since it is set to German. Have you tried the solution mentioned here to override it?
Oh yes i did and i forgot to mention that. The forceCodepage parameter did not change it but since the other user reported success i will retry it again and report back to you.
Maybe i messed something up.
Okay, sounds good. You may also need to try some of the options for non-english language support here: https://github.com/point-source/dart_ping/tree/main/dart_ping#non-english-language-support
If you need help creating German regexes, let me know
@point-source Thanks! So i digged a bit more.
forceCodepage: true
seems to be not relevant for this problem. The problem is indeed the german umlaute that can't be parsed.
Example ping:
ping ynnob.com
Ping wird ausgeführt für ynnob.com [157.90.5.237] mit 32 Bytes Daten:
Antwort von 157.90.5.237: Bytes=32 Zeit=18ms TTL=55
Antwort von 157.90.5.237: Bytes=32 Zeit=17ms TTL=55
Antwort von 157.90.5.237: Bytes=32 Zeit=20ms TTL=55
Antwort von 157.90.5.237: Bytes=32 Zeit=15ms TTL=55
Ping-Statistik für 157.90.5.237:
Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
(0% Verlust),
Ca. Zeitangaben in Millisek.:
Minimum = 15ms, Maximum = 20ms, Mittelwert = 17ms
Setting the codec to Utf8Codec(allowMalformed: true) produces:
Setting the code to latin1 produces:
Additionally i tried my best to create a regex template for that:
final parser = PingParser(
responseRgx: RegExp(
r'Antwort von (?<ip>.*): Bytes=(?:\d+) Zeit=(?<time>\d+)ms TTL=(?<ttl>\d+)'),
summaryRgx: RegExp(
r'Gesendet = (?<tx>\d+), Empfangen = (?<rx>\d+), Verloren = (?:\d+)'),
timeoutRgx: RegExp(r'host unreachable'),
timeToLiveRgx: RegExp(
r'Antwort von (?<ip>.*): Die Gültigkeitsdauer wurde bei der Übertragung überschritten.'),
unknownHostStr: RegExp(
r'Ping-Anforderung konnte den Host nicht finden. Überprüfen Sie den Namen, und versuchen Sie es erneut.'),
);
This produces a output but is missing the bytes. the 'seq' capturing group is not set in my template but i don't think this is intendended to represent the bytes right? just wondering, i don't really need that information.
But what is 'seq' representing in the timeToLiveRgx RegEx? It seems to be required but i can not see you extracting that information int the documentation example https://github.com/point-source/dart_ping/tree/main/dart_ping#non-english-language-support
Btw: Using forceCodepage breaks the custom parser example because the codepage number will trigger a match for timeToLiveRgx which will ultimatly fail because the expected captuaring groups are not actually captured.
Maybe you can help me out a bit with the Regex! Thank you
Almost the same error as #65 but the offset is different.
ping to google.com produces -> Unexpected extension byte (at offset 18) ping to https://google.com produces -> Unexpected extension byte (at offset 64)
OS: Windows 11 Language: German
main.dart
Exception: