So I recently switched from Sublime 2 to 3 and I can't get it to show some 'bad' characters (like the encoding/pasting) bugs. Why I need it:
Sometimes somebody sends me a piece of code (snippet or google analytics code or whatever) via email. I know you are not supposed to send it via email because the mail may add some not wanted characters into code but people still do it. So person sends me some URL via email which ends like this: /org - you notice that 'bug' between '/' and 'org'? I am sure some of you know how its called.
But when I take this "/org" and paste it into the .php file or .html file or whatever, then Sublime Text 3 will no longer display it! It will just show "/org" like that bug is not even there - but it is there and that url/code/whatever is of course wrong and its invisible/impossible to find it!
So how can i force Sublime 3 to show these bugs? That's all I need really, just to know when I paste accidentally some bad/corrupted piece of code/string into my script, that there actually IS something bad/corrupted. How can I make Sublime to display everything the same way pastebin does?
Gremlins plugin for Sublime Text 3 does exactly that (it helps to “identify invisible and ambiguous Unicode whitespace characters”). Zero-width characters are marked with an icon in the gutter.
This appears to meet your needs (if not every one of your desires).
Unicode character highlighter for Sublime Text 2 & 3
This plug-in highlights characters such as non breakable space, characters that often break compilers and scripts and is almost impossible to spot in the editor.
Related
In my previous IDE which I used for my website's files there was a very useful option to configure key replacements. Particularly I would like to make sure that extended characters which are to be printed on the web page are added in their respective HTML-code and not as UTF-8 characters or so, because only then I'm on the safe side that the display is proper. So, that old IDE used to put ä into the text where I entered "ä", and so on.
Is there a way to do this in Eclipse as well? I found that many things are configurable, but I didn't find anything like this key replacement. It's kind of a makro thing, but not really, and is only needed within the editor.
Thanks for any suggestions/help.
The AnyEdit Tools plug-in can be used to convert special characters and umlauts into HTML entities:
Select the text to convert and hit Ctrl+Alt+E (or right-click and choose Convert > Chars to Html Entities)
I am using Redactor.
When pasting in text whether its from Word or Textedit I am getting really odd characters after saving.
For example an apostrophe is being changed to ’ and any time I open that page and re save it adds even more characters like this ‚¢ÃƒÂÂ
The page uses utf-8 charset
Any help would be great. Thank you
I have a wordpress installation that clients can edit, all characters display ok. On the main homepage I query the same database for the same title and post content, but it doesn't display correctly - just a question mark
I have tried sending the utf8 headers manually, through htaccess and through meta tags. I have used SET name UTF8 (which turns the characters into the diamond symbol with a questionmark inside).
I genuinely cant figure out what it could be now and I really need these characters to display correctly.
Heres the homepage, you can see in the Sounddhism 6 preview that there are lots of question marks, if you click on it you will see what they are meant to look like
http://nottingham.subverb.net
I have passed it through the validator and it gives me this error:
Sorry, I am unable to validate this document because on line 373 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: utf8 "\xA0" does not map to Unicode
Which, i appreciate is supposed to help me, but I don't know what to do about it. Especially since that line, the letter generating the error is supposed to be a space and is AFTER the offending question marks.
Can anyone help?
Compare the encoding of both the back-end scripts in Wordpress and also your homepage script. If you're using IE, right-click the page and check the encoding. Sometimes it's set to "Auto-detect" and IE will often detect a different encoding for different pages, causing strange issues like this.
If you're not using IE, try using a tool like Fiddler to see exactly what encoding (and what bytes are being sent back and forth both in the back-end and your homepage script.
If forcing UTF-8 on your homepage script doesn't work, I would guess that the back-end is not using UTF-8.
We have a textbox where users will be entering reviews. They should be able to do simple formatting things like bold, italics, lists, headers, etc... Our problem is that the majority of our users will most likely create their reviews in MS Word then copy/paste the text to our form. As you know, this can (and mostly will) cause problems when displaying the data. What is the best way to provide the simple formatting functionality without having problems when they copy/paste from Word?
The best solution would be some type of filter that takes text from Word and strips out everything unneeded or illegal.
You could write an add-in that exposes a single button with the text "Copy for Review". Your add-in would do all the cleanup that you'd want.
This question was previously posted to the TinyMCE HowTo Forum with no responses. Here's hoping that someone out there has encountered (and solved) this issue.
The question: Is there some way to enable correct copy/paste of formatted text from a Lotus Notes email directly into TinyMCE?
The scenario: A rolling comments system on a web site, into which users occasionally need to paste rich text from an email viewed in Lotus Notes.
The details:
I have tried copying some formatted text from emails viewed in Lotus Notes (7.0.4, Windows XP) and pasting it into the "Full featured example" implementation of TinyMCE at http://tinymce.moxiecode.com/examples/full.php and found that it generally fails to maintain the formatting. In fact, of the browsers I tested, IE6 fared the best, and the more modern W3C standards compliant browsers were the worst.
Some text formatting I tested was:
larger text
underline
italics
bold
numbered list
bullet list
indented text
permanent pen
font family: arial
font family: times new roman
Results:
-Firefox (3.6.8), Vista or XP: all formatting lost
-Chrome (5.0.375.125), Vista or XP: all formatting lost, including line breaks
-IE6 (XP): some formatting is maintained (fails to copy numbers and bullets for lists, but indents lists properly)
-IETester (IE6) Vista: some formatting is maintained (fails to format lists at all, and the underline tag is not closed)
-IE7 (XP): some formatting is maintained (fails to format lists at all, and the underline tag is not closed)
-IE8 (Vista): some formatting is maintained (fails to format lists at all, and the underline tag is not closed)
If I first paste the clipboard from Lotus Notes into MS Word 2003 (11.5604.5606) it shows perfectly in Word, and if I then copy/paste it from there into TinyMCE it generally works better enough to be usable, although still loses some formatting, even when using the "Paste from Word" button in TinyMCE. Not surprisingly, if I open my Lotus Notes mail in a web mail client, the HTML mail copies and pastes perfectly into TinyMCE.
Since it shows perfectly in my Domino web client, and pastes perfectly into MS Word, it is obviously possible to copy/paste Lotus Notes formatting.
If anyone has had success with this please mention your Notes and browser versions, and any modifications you had to make to the TinyMCE config.
If you check what's pasted from Word, you'll find that it's pretty much what you'd get if you had done a File->Save As->Web Page in Word: a whole bunch of Word-specific HTML attributes and CSS. Essentially, it's Word's ability to be coerced into exporting HTML that does the trick; Word's rich text alone won't do the job. The Notes clipboard (which is different from the system clipboard) can export RTF to the system clipboard, which then pastes (with limitations) to Word (which can interpret RTF), but a JavaScript widget in the browser doesn't understand RTF.
You can use the w32 api to do your formatted copy (e.g. make a special copy btn in LotusScript and call it). I have actually done this, and it works fine.
however, will TinyMCE handle the paste operation well? - that I cannot tell you.
I have logged this as a bug against TinyMCE.
Ok, then eigther you will need to deactivate the paste plugin and write a plugin of your own or you will have to configure/change the paste plugin to your needs.
If I first paste the clipboard from Lotus Notes into MS Word 2003 (11.5604.5606) it shows >perfectly in Word, and if I then copy/paste it from there into TinyMCE it generally works >better enough to be usable,
Thing is, that your OS detects (at least sometimes) from which kind of context (plain text, html,...) copy-paste is done. That probably is the reason why copying it first into Word helps a bit.