Hi, This doesn't seem to work. Can I try anything else. and how does then blink process any external stylesheet which is having such Hex values and show them correctly in ParseStylesheet. and if I take rules from same point and add them to new style node, the text is getting converted to unicode chars. is there anything I am missing in the process.? On Monday, November 6, 2023 at 12:46:40 PM UTC+5:30 Mathias Bynens wrote:
> Make sure the document uses UTF-8. In HTML, you’d add > > <meta charset="utf-8"> > > On Fri, Nov 3, 2023 at 4:05 PM kalyani Shinde <[email protected]> > wrote: > >> Hi Team, >> >> I am facing weird issue while creating style node with text node in it as >> follows: >> >> I want to add below rule to style tag for example: >> >> /* >> >> .my-class:before { >> >> content: "\F1F0" >> >> } >> >> */ >> >> And here is my code >> >> Element* style = document->CreateRawElement(html_names::kStyleTag, >> CreateElementFlags::ByCreateElement()); >> >> // Append the style element to the head >> >> headElement->appendChild(style); >> >> std::string text=".myclass:before {\n content: \"\\F1F0\"\n}\n"; >> >> // it should be as below >> >> >> style->ParserAppendChild(static_cast<blink::Node*>(document->createTextNode(text.c_str()))); >> >> >> This code turns my style node having data as below: >> >> my-class:before { content: ""; } >> >> >> I have noticed, inside StyleSheetContents:ParseString this rule gets >> received as >> >> my-class:before { content: \"\u00EF\u\0087\u\00B0"; }\n" >> >> >> Why is this text node creation causing my Hex value to change, And if it >> is so, then how should I handle this. >> >> >> Thanks >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "blink-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4623d61c-212f-4a02-92d0-24e0e23976a2n%40chromium.org >> >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4623d61c-212f-4a02-92d0-24e0e23976a2n%40chromium.org?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/bce0144f-30e2-4253-a21e-baa7941e943an%40chromium.org.
