html page failing to display rupee currency symbol - html

I have a database configuration table that holds the rupee symbol &#8377.
when my page loads a java class reads this value using jdbc from the sql server database and using xslt transformation displayed in a table.
there are no issues with the $ UK pound symbol etc, but rupee will not display. In the table I see that the value &#8377 is displayed and when I view the source I see that the text has been escaped to &#8377.
If I edit the source in chrome and change &#8377 back to &#8377 it displays fine, I'm trying to work out how to prevent this escaping from occurring.
I have tried to escape the & with \&#8377however this is still encoded to\&#8377.
I have also tried directly sticking the &#8377 into the xslt sheet in line with some text like:
<h2>Some text (&#8377)</h2>
but with this it displays as 'Some text (?)'
There must be a simple solution to this one but I've not found anything so far :(

Related

Rich text editor replaces characters with html

Oracle apex version: 20.1
I have a form in which the user can copy and paste email chains into a rich text editor form field. The form field is based off a column in my table that is stored as a CLOB. As you can see here: Form Field Displaying Email the rich text editor does an amazing job at preserving the characters, indentations, and the image as well.
The problem is we save hundreds of these emails, so when we have to provide information to an outside source we have to include all of these emails. We obviously don't want to have to click into each one of these records and copy/paste the email into a file and send them one by one. So I created a report that can display all of them at once, then use a print feature to save the report as a PDf. The description column is of type: Remove HTML. Report Displaying Email (This is the same email but I also pasted the reply to the email on top)
As you can see it has problems when it runs into certain characters. Almost all apostrophes are replaced with either ’ or '. Bullets are replaced with • and greater/less than signs are replaced with >. My character test line of !##$%^&*(){}><?/ displays as !##$%^&*(){}><?/
Is there a better way to format all of these emails so they can be downloaded into one file (pdf)? How can I tell apex to leave all of those characters alone while still removing the html?

How do I fix the encoding of the quotes?

I am using the free plan of the wordpress.com platform to host reference information on a small site. The goal is to be able to copy the code from the site page and place it in your own IDE, such as VSCode. Since the plan is free, all Wordpress features have been cut to a minimum, including the installation of plugins. It is possible to use only standard blocks such as HTML, Code, Classic Editor, etc. When it became necessary to publish highlighted code, I did not find anything better than to copy it from my code editor and convert it to HTML, then insert it into Wordpress standard HTML block. And for the first time everything was fine, i.e. I was able to copy a block of highlighted code from a page on my site and paste it into the VSCode code editor. And the code was displayed in the same way as on the page. But suddenly, everything changed and the following problems arose: the single quotes character (') began to display as an opening single quote (‘) and a closing single quote (’), which makes the code inoperable and needs to be edited, which is extremely inconvenient:
describe(‘Examples for Querying commands’, () => {
before(‘Navigate to querying page’, () => {
cy.visit(‘https://example.cypress.io/commands/querying‘);
});
// Скопируйте интересующий вас пример и вставьте его здесь
});
Double quotes began to display incorrectly on the site itself. Instead of ("), they began to display as (»):
cy.get(‘[data-test-id=»test-example»]’)
What could such a metamorphosis be connected with? It happened after the next resave of the edited page. The single quote character is encoded on the page as &apos replacing it with the symbol (') itself does nothing either. You can watch it here: https://kitchensinkcypress.wordpress.com/%d0%bf%d0%be%d0%b8%d1%81%d0%ba-%d1%8d%d0%bb%d0%b5%d0%bc%d0%b5%d0%bd%d1%82%d0%be%d0%b2/. The site is under construction. Please tell me how I can overcome it?
I am not sure if I can treat this as an answer, but it would be an answer if this is Wordpress bug. I found out that the reason of the issue is page update. Steps to reproduce:
Create html snippet for the highlighted code example.
Save it into html file, open the file in browser and ensure that all characters are displayed properly.
Create HTML block on the page and insert there the content of the mentioned html file.
Open the page in browser and insure that the code is displayed properly.
Copy the code snippet from the page and paste it into VSCode editor. Ensure that the code is displayed properly.
Now make any changes anywhere on the web page except of the mentioned HTML block and press Save button.
Expected result: The mentioned code snippet is still displayed properly as no changes were maid inside its HTML block.
Actual result: The snippet has been corrupted. Double quotes (") is turned into (»), single quotes are displayed as opening single quote and closing single quotes if being copied from the page and pasted to VSCode editor:
cy.get(‘[data-test-id=»test-example»]’)
which makes the code not usable. So I believe that this is a Wordpress bug as we have two different results for displaying of the same block of the html code without any user manipulation over this block.

Check for visual presence of character on page?

I'm in an odd situation where I need to check, via a test, that a currency symbol is being properly displayed on our web page.
We've been running into issues where sometimes the unicode alphanumeric value is showing up on the page instead of the actual currency symbol itself.
Is there a way to check for something like this? Like with some type of visual checking library, or through javascript?
The answer to this issue was to specifically copy and paste the unicode character I was looking to test against into my text editor.
So using the Protractor framework, I would find my css element, and if I have a known price of 17.99 that should be returning, my test function would return:
return expect(myPriceElement.getText()).to.eventually.equal(£17.99);
If on my webpage, £17.99 shows up, then my test will pass

Google Charts: HTML entities in NumberFormat prefix

I'm trying to get the UK GBP symbol (£) to show up correctly in my Google Chart's table but I'm finding that HTML entities seem to be automatically escaped.
var formatter = new google.visualization.NumberFormat({
prefix: '£',
});
The above example literally shows £ in the table rather than showing up as the correct symbol.
Is there any way to get it to show up as it should be?
Previously I tried just using prefix: '£' but it was making the pound symbol show up as a blank square instead. I then searched and found another stackoverflow question suggesting that the person use the straight UTF-8 value -- in this case it becomes prefix: '\u00A3' which is quite unreadable.
I've just discovered that using the pound symbol directly works if I make sure my Javascript file is set to be encoded as UTF-8, but I'm still interested in general as to how you would get HTML entities to show up.
If you want regular HTML entities to show up, you have to set the Table's "allowHtml" option to true.
Edit:
To clarify, "allowHtml" only works on Tables and OrgCharts. The SVG/VML-based charts (Area, Bar, Bubble, Candlestick, Column, Gauge, Geo, Line, Pie, Scatter, Stepped Area, Timeline, and Treemap) don't support HTML entities; you have to use the unicode value for the character.

File upload mojibake

How do you do a file upload in an HTML form without running into mojibake?
I have a form that has three fields:
a file field
a required text field
a text field which accepts Japanese characters
I've set up my HTML form with the attribute enctype='multipart/form-data'. But when the form submission fails due to the missing required field, I get redirected to the same page but my 2nd text field (the one that accepts the Jap. chars) is already mojibaked.
However, if I remove the enctype or change it to anything else, and when the form submission fails, I see the Japanese chars as they are (no mojibake). The problem is, if this succeeds, I am unable to read the uploaded files.
Any ideas how to fix this??
Mojibake (mangled display of Japanese characters) can have two causes:
The data on the page is in the right character encoding, but the browser does not recognize it.
Some characters on the page use the wrong encoding (the server wrote them in an incorrect encoding).
If the other characters on the page (outside of your form) show correctly, you produced broken output on your server.
If everything is clobbered, and you can fix it by manually setting a different encoding from the browser's menu, then the page encoding is not properly specified.
What kind of content-type headers and HTML meta tags do you use?
I've figured it out (by reverse-engineering appfuse (appfuse.org) which does not seem to be affected by mojibake with its file upload form ).
It solved it by setting the charset encoding to UTF-8 in the server side (with spring's org.springframework.web.filter.CharacterEncodingFilter ). Thus, I guess multipart-/form-data really does screw up the character encoding ( or at least for java ).