I have my Website Created with Meta Tag charset as UTF-16 in the Head Block
<meta charset="utf-16">
So if I Check my Site on Chrome Manually the Data is Loading Fine, But when try to Open the Site Through cy.visit() and Launch the Browser we are getting Gibberish Values
When I Inspect the Cypress I could see that the Cypress is using Charset UTF-8
There are no Extra PlugIns Installed just Cypress, The Version Cypress used is 13.7.0. I have updated it to this Version from 10.10.0
You are looking at the Cypress test runner (the main browser window), not the application under test.
The app is loaded into an <iframe>
and that document has <meta charset="utf-16">
. To find it, right-click/inspect some text element on your page, which takes you to the elements tab of dev-tools.
From there, look up the HTML tree to find the nearest <head>
(not the one you show in the picture).
If your web page really has utf-16
you will see the same in that head section.
To test, use this code which should pass (it does on my sample)
cy.visit(my-url)
cy.get('head meta[charset]')
.should('have.attr', 'charset', 'utf-16')