Quickly, before I begin, Torch is a chromium browser which I use on my desktop PC. I use Chrome on my Macbook Pro 13 inch (256gb one, probably not important), and I get the same issue, which is, in my opinion, really weird given that they're completely separate apart from each other except for how they're both logged into the same account.
So, onto the problem at hand. On some random websites, most notably a Chrome extension called Audio EQ, as well as some local sites such as chrome:// and torch:// depending on what browser I'm using, I get a random string of Chinese characters. It can be translated but it never means anything, so I figured that it's an encoding/decoding error due to the random nature of the text.
The text that's displayed in Audio EQ is this:
http://pastebin.com/RY4048QU
As you can probably tell, this is broken.
I ran it through a batch decoder/encoder website thing, and encoding to UTF-16 resulted in something that looks a little bit more like HTML.
(I would post a link here to it but I don't have 10 reputation, so check the replies to this post below for the link)
It's HTML. Sort of. The text is backwards and the syntax is a little bit off but it at least looks like HTML now.
So what's going on here? How come it happens on both my Mac and my PC even though they're mostly separate (And if it's because they're using the same Google account, how does this affect how encoding/decoding happens?)? Most importantly, how should I go about fixing this?
Thanks for any replies, and sorry for including a lot of text, although this is a more complex issue than I'm used to asking about.
Related
I've noticed a trend of using emojis for CSS classnames.
.ππΎ-Vg{color:#ff4040}
.ππΎVDe{padding:.75rem 0;font-size:1rem}
It makes certain things more difficult. e.g. writing Selenium tests over these pages.
Is there a real benefit to using them? Security? Filesize?
Or are developers just doing this for kicks?
Edit: For the "Close (Opinion Base)" voters. I genuinely want to know if there's a development reason for doing this. I'm not looking for people's opinions here.
Im going to tenatively answer this while trying to not to be too 'Opinion based'
The 'emoji' support is a feature of supporting all Unicode characters, this was to support Chinese charachter support, which makes perfect sense.
As Emojis have been mapped to the Unicode chars, they came out of the wash too.
I have trouble finding legitimate references to bytes saved with emojis in-lieu of another method. So if someone could correct me that would be helpful.
The closest I found was a gitLab document from 2018 which moreso speaks to the performace improvements they saw implementing the native Unicode emojis.
GitLab Emoji Unicode
Appart from anything else though, I have seen some companies throw them into CSS files to attract some 'UI' enthusiasts while browsing the source of a site, for hiring purposes.
Opinion Spoiler - If I saw this in a company content, the last thing I would be doing is applying to work with that.
Final Note
This really is not useful in any practical way, if you are working as part of a team, ask them yourself how they would feel about searching through a source base using an emoji/unicode instead of some readable class/reference.
π₯
Reading Material
Browser Support SO Question
CanIUse Unicode
Unicode Release with Emoji Support
From what I have read from a forum, the reason people use emojis is because it can shave bytes off of files and it is easy to understand.
As far as I know this is not a security thing.
Starting this afternoon, with the introduction of Chrome 31.0.1650.48, many web pages are displaying with random formatting errors. I've confirmed this on both Mac and Windows machines running the most recent auto-updated Chrome release (31.0.1650.48).
This problem is affecting thousands of pages, and to immediately rule out our server generating different information, you can try this to reproduce the problem:
Visit this Google cache page with Chrome version specified above: http://webcache.googleusercontent.com/search?q=cache:nt70v_rn5BwJ:alaskanmalamute.rescueme.org/Idaho+&cd=61&hl=en&ct=clnk&gl=us
Notice what dogs are displayed and where they are.
Reload the page several times and observer closely.
You will randomly see one dog listing in the middle of the page, then two dog listings, the dogs move around, the menus around the dogs move around. Each time the page is reloaded Google is corrupting the source code in different ways, resulting in major formatting issues. (NONE of this code is generated outside of Google's cache.) All the pages on the www.RescueMe.Org have this problem, I'm using a cached page on Google's server in this article for an example since it proves it is not a server issue.
This sample page should remain the same every time, and be formatted correctly. It isn't.
Google Chrome (when viewing source) seems to be making random changes to the page (Chrome is dropping < or > at random places in source code) causing major display formatting issues.
Can someone reproduce this? Hopefully the folks at Google know about this issue, or someone here can escalate it with them?
Best wishes,
Jeff
can confirm - it seems to mostly be an issue with iFrames.
VisualForce iFrames in Salesforce break the entire layout.
Version 31.0.1650.48 on Mac, all addons removed.
In case someone else runs into this issue, I've narrowed it down somewhat. Chrome/31.0.1650.48 will randomly scramble the placement of tables on a page if the following two things happen:
1) You start the page like this: and do the reverse at the end: (doesn't have to be face=arial, any font setting or even just does the same thing).
2) Include some tags within the page containing various tables.
3) Magic! (not good magic, though) Each time your tables will randomly move about the page. Here's an example to try: http://server1c.rescueme.org/testb (Reload this page several times in in Chrome/31.0.1650.48 on Windows or Mac to see the tables jump around.)
THE SOLUTION: Start the page like this instead: and do the reverse at the end: (in other words, reverse placement of the center and font tags). Here's the "fixed" version of the page above with just those tags reversed: http://server1c.rescueme.org/testbfixed
While this is a Chrome bug, I feel this is worth keeping in Stack Overflow because this bug is breaking a lot of major sites, and programmers may want to know how to reprogram their HTML so those who have affected versions of Chrome won't have a confusing experience.
FYI... There are other ways to cause and solve this problem, but I'm trying to present here just the simplest method I found.
It's possible using alivepdf to write a Unicode pdf?
I see a Unicode.as class, but when I try, the pdf created cannot be opened by adobe reader.
Could you please suggest me some code snippet to create a unicode string?
[EDIT]
I have made some investigations. I think the problem is on putcidfont0 method on UnicodePDF.as class.
The problem is that I think the font metrics are not parsed well and many characters are displayed with the default font width.
I cannot say how to fix this...
Try delcaring a new UnicodePDF() or setting the isUnicode bit to true (see documentation)
I dealt with this a month or two ago. My issue was that certain characters I would pass to AlivePDF would result in a broken PDF.
In my case I still had issues and my research turned up no promising results, although someone else had a strikingly similar issue that may be worth reading in your case.
The AlivePDF library hasn't been updated in a few years, and with my experience it seems like it doesn't play entirely well with unicode / other languages, although I have used it for English content without issue.
Since my target was desktop Flash and I was generating the PDF content from an external XML file, I eventually just wrote a helper utility app using C# and PDFSharp, which may or may not be an option in your case.
There was a big discussion here
Also I noticed that online PDF to Doc converters read UnicodePDF() files well.
Hope it helps.
It seems that some characters, as greek accented, some polish and many other characters are not available trough cid fonts, so the only way is to embed font in pdf.
I do a decent job of formatting my HTML and keeping it clean, but every time I view source there are elements all over the place. I guess that's fine since it won't make the page load any faster or slower and makes it harder to copy, but it just looks ugly and I wish it didnt
Why?
View Source in a web browser will show exactly what the server sent to the client. If you're really formatting your HTML nicely and it doesn't look exactly the same on the client, then there's something else in the middle that's making it not line up the same, such as a server-side technology like PHP or ASP.NET which is being used to generate some of the markup.
Also it's possible you're seeing it different due to spaces. If in your development environment you're mixing spaces and tabs and have one tab equal to 4 spaces, for example, and then in the browser it might be one tab equal to 8 spaces, then things won't line up right. To fix this, either always use tabs or always use spaces. Most decent IDEs will swap between tabs and spaces automatically for you (like Visual Studio).
Some browser tools like Firebug and Chrome's Developer Tools will show the DOM tree as the browser understands it. This is a translation of the DOM back to HTML and is not likely to be the exact same as what the server sent the content. It is formatted perfectly though.
I'm not sure why your HTML is not lined up properly in your browser's View Source. It would be helpful to actually see your HTML.
Some of the common culprits include:
a mixture of tabs and manual spaces for indenting code (if you want things to look pretty, do one or the other).
possibly a mixture of Windows, Unix, and Macintosh line breaks (CR/LF), which can happen if code is edited from multiple computers. I've had issues with this, but I'm not sure if it would cause the issues you're describing; perhaps not. (I'm sure others can comment more knowledgeably on that possibility.)
your site is managed through a CMS that emits terrible HTML
It may be useful for you to look at HTML Tidy. I haven't used it yet, but I've always heard good things.
I'm looking for a web based word processor. I'd like something that prints exactly what the user sees on the screen.
It's for an internal app so I don't need something available only through the Internet.
You will find it very very hard to have a consistent experience on screen and on users's computers. If you can control the environment to a point where you can force all users to use the same browser on the same OS you'll be fine, otherwise you should try a more hybrid approach. Something that can have slight print variations but also works fine.
Google Docs uses a verry interesting method for presenting the info to the user before printing. They convert your page to a PDF, prior to printing and there you can see exactly what will be printed or not. If you're good to go, shot. If not you can come back to the textarea and keep iterating.