Coder Social home page Coder Social logo

Encoding Problem about netdev HOT 4 OPEN

selfuryon avatar selfuryon commented on June 16, 2024
Encoding Problem

from netdev.

Comments (4)

waqasraz avatar waqasraz commented on June 16, 2024

I need some help with this issue, please if anyone has any idea.

from netdev.

selfuryon avatar selfuryon commented on June 16, 2024

Hello!
No problem! I will try to help! Can you provide information about your Juniper router? Version? Model? I find out that we recognize the place where you have a problem. Did you try to change comment? Maybe repeat to type 'n' again? Maybe this 'n' letter not from english by mistake?

from netdev.

waqasraz avatar waqasraz commented on June 16, 2024

Hi, Thank you, Actually, I was able to have some idea about the problem. In some of the routers, engineers added some Unicode characters in the descriptions. So when we try to decode it using UTF-8 it just gets the decode error. Thank you for the good work in the library.

Just on a side note

_pattern = r"\w+(\@[\-\w]*)?[{}]"

this pattern returns partial juniper output as I've tested show configurations on many routers. This one works fine

_pattern = r"\w+(\@[\-\w]*)"

from netdev.

wallies avatar wallies commented on June 16, 2024

@waqasraz we had similiar issue to this and we solved it by using this
codecs.register_error('strict', codecs.backslashreplace_errors)
https://docs.python.org/2/library/codecs.html

from netdev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.