Giter VIP home page Giter VIP logo

Comments (5)

Yortw avatar Yortw commented on August 19, 2024

Hi,

Thanks for the problem report :)

I've spent some time looking and I think the problem is the TextAsHtml function. I believe the twitter entity indices are true 'character' positions, but the string/stringbuilder methods used to parse and update the original string are really byte based (regardless of what the docs might say). I've seen/suspected this before but never found a solution.

In your sample tweet the first url entity has a start index of 106, but the string functions being used only return the correct text if position 110 is used. The additional 4 bytes seem to be because each of the emoji/smiley characters is actually 2 bytes but being treated as 1. I think this can be solved using System.Globalization.StringInfo to measure actual characters, but I've run out of time tonight to try and produce a solution.

from tweetmoasharp.

Yortw avatar Yortw commented on August 19, 2024

Hi,

I think I may have fixed the problem. I've pushed a new build to nuget, could you please update your solution and try again to see if this helps?

Thanks.

from tweetmoasharp.

Yortw avatar Yortw commented on August 19, 2024

Hi,

Any chance you've tried the update? Can I close this issue?

Thanks.

from tweetmoasharp.

steviemcg avatar steviemcg commented on August 19, 2024

Thanks for your speedy response! This indeed fixes the issue so it can be closed. Thanks again.

from tweetmoasharp.

Yortw avatar Yortw commented on August 19, 2024

👍 Thank you!

from tweetmoasharp.

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.