danielzzz / node-ping

a poor man's ping library (using udp scanning) for node
MIT License
336 stars 105 forks source link

output does not log special characters #155

Closed DDantasL closed 1 year ago

DDantasL commented 2 years ago

hello, I'm using the lib but my language is Portuguese, how do I do to change to utf8?

DDantasL commented 2 years ago

the output ![Uploading 20221123_222421.png…]()

DDantasL commented 2 years ago

20221123_222421

mondwan commented 2 years ago

Have you tried to config the system locale through node Js?

On Thu, 24 Nov 2022, 02:26 Daniely Dantas, @.***> wrote:

[image: 20221123_222421] https://user-images.githubusercontent.com/48628075/203680344-45dcac7f-18d8-49a5-8093-62eef704c1a8.png

— Reply to this email directly, view it on GitHub https://github.com/danielzzz/node-ping/issues/155#issuecomment-1325867726, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5YBI3Q5AIPMQECDCERUZDWJ3G4FANCNFSM6AAAAAASJTT7HU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DDantasL commented 2 years ago

yes, but the output insist to be with that question mask in the special characters

mondwan commented 2 years ago

We are using child_process.spawn() in order to run the system ping. I have a quick look on the encoding from the manual. I don't find any useful information.

I will suggest you have a look, and tried to edit following lines of our library in your local installation. We are happy to help & patch the library if you found the way for making it work. Thanks

https://github.com/danielzzz/node-ping/blob/master/lib/ping-promise.js#L48

https://github.com/danielzzz/node-ping/blob/master/lib/ping-promise.js#L72