How do I get Chrome to display a text file containing backspace characters?
I have a static text file on a server that contains backspace characters (ASCII code 08), and when I navigate the file's URL in Chrome (or Safari), the browser downloads the file to a folder instead of viewing the file's text in the browser window.
I've confirmed that the Content-type header is sent correctly, and if I remove the backspace characters, it works correctly again and displays in the browser.
I don't care if the browser shows an odd glyph or code where the backspace is, or if it dutifully removes characters preceding the backspaces, but I do want to view the file in the browser.
I have control of the server, so I can send custom headers if that helps. Also a browser plugin/extension would be okay.
Related
I'd like to know why base64 images are mangled in Chrome's dev tools Watch values:
When I right click on the underlined value -> "copy value" Chrome decides to remove a GREAT part of the original base64 code, and to add "..." in between, destroying the base64 encoding
After making a text diff between what I've obtained from Chrome dev tools and the base64 data that reaches the server and I found there was a huge part of the text missing on what Chrome shows as the value and the infamous "..." (indicating that there should be more code in between i guess) that should't be there either
So What should I do to be able to retreive the proper value of a base64 image on Chrome dev tools?
I was working on an html file suddenly after restating my laptop when I open the file is brackets it says brackets can only open Utf-8 encoded files, when I open it with Nenter image description hereotepad++ it shows nul and when I open it with browser it shows a blank page.
Need help
I noticed strange behaviour for google chrome.
I have web application based on java spring-mvc framework.
In head tag <meta charset="utf-8">is set.
For each page response headers return Content-Type:text/html;charset=UTF-8
In IE 8,9,10,11 and FF if user changes encoding in browser's settings to KOI8-R and then goes to another page inside domain - browser encoding will be automatically returned to UTF-8.
BUT in google chrome in same case KOI8-R will be present even if we go to other pages inside domain.
Is it expected behaviour for Chrome? Maybe it is some kind of bug?
Chrome doesn't like to use UTF-8 by default so you have to do:
Click the Chrome menu on the browser toolbar.
Select "Tools"
Select "Encoding".
Pick one "Unicode (UTF-8)" from the menu of encodings
To make the client do this by default you would probably have to write some script but I'm afraid I can't help you out there.
When I paste a url containing some reserved characters to the address bar of IE, FF, Chrome, I see that it displays it as it is but as far as I understand in uses percent-encoding in the background.
How can I see in IE, FF and Chrome how the browser encoded the url?
Is it possible?
P.S: The reason I want to check this is I have a feeling my url is encoded differently in IE and FF and Chrome -so that it only works in IE.
Put the URL into an HTML page, ie,
click
Load in each browser, right-click, copy URL, paste into a text app or the address bar.
You can also use:
<script>
alert(encodeURIComponent('the text you want to see encoded'));
</script>
Copy the URL from the browser’s address bar and paste it into a text document.
If you save a txt file and open it w/ chrome or firefox, I noticed that the the doctype declaration isn't added when I inspect the element in question. Instead it's just 'html.'
Is there any reason for this? Because it does make a difference to the 'pre' format's style and layout when you do add doctype html.
Edit: OK, when a browser opens up a txt (whether locally or thorugh HTTP) it does not open a txt file, but converts it to raw html. And Matt Ball is wrong - because the browser is not opening a txt file - it's converting a txt file to html. Example: gutenberg.org/cache/epub/4300/pg4300.txt Now inspect it's element - you'll notice it's not display the actual txt file but an html document
The doctype is a signal from the programmer to the browser, originally intended as a shibboleth to indicate that the programmer knows what they're doing.
The browser already knows what it's doing when it's opening a text file: not opening an HTML file.