0

I have the following code in PHP:

$v = mb_strlen($linebuffer, 'HTML-ENTITIES');

which works for strings like "X "FUEL"" and returns 8 (X "FUEL").

I need this exact same code in javascript and/or jquery. Does this exist or will I have to write an entire parser in javascript?

Sevenel
  • 1
  • 3
  • Welcome to Stack Overflow! Visit the [help], take the [tour] to see what and [ask]. Please first ***>>>[Search for related topics on SO](https://www.google.com/search?q=mb_strlen+javascript+site:stackoverflow.com)<<<*** and if you get stuck, post a [mcve] of your attempt, noting input and expected output using the [`[<>]`](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. – mplungjan Apr 12 '21 at 11:31
  • Is [this](https://stackoverflow.com/a/34332105/4205384) of any help? – El_Vanja Apr 12 '21 at 11:32
  • https://stackoverflow.com/a/67057751/295783 – mplungjan Apr 12 '21 at 11:43
  • The example in the "duplicate" questions do not apply to HTML. I tried: var x = unescape(encodeURIComponent(linebuffer)).length; – Sevenel Apr 12 '21 at 11:44

0 Answers0