Automatic HTML escape sequences conversion from Design View to Code View - dreamweaver

I have been searching on the web unsuccessfully for a Dreamweaver facility I know exists, and it's quite useful.
In Code View, for typing characters like "ç", we type &ccedil ; as the best practice. What I would like to know is how to be able to type a word that contains the character "ç" in the Design View and get it automatically escaped in the Code View, thus without requiring my own intervention to escape it.
Is that option present among the Dreamweaver preferences? I have not found it.
Thanks in advance!

There isn't an option in preferences to do this but Dreamweaver will do it if the Encoding is set to something other than UTF-8 or other encoding option that doesn't natively support the character.
Start a new, blank page and do Modify | Page Properties | Title/Encoding and change whatever is in the Encoding box to "Western European" and then paste the ç character. Switch to code view and you will see the encoded version. If your page is set to UTF-8, you'll see the ç character in both views.

Related

MBCS File Menus generate ???? Characters

I am working on an MBCS app using MFC. I am trying to support Asian languages. For the purposes of this discussion, we'll say I'm trying to support Chinese. I am able to support Pop up dialogs via MessageBoxW and Dialog SCREENs by pasting Chinese characters directly into the RC file. I can't get file menus to work using either resource view or editing the RC file directly. Whenever I type in ANY Asian character, the screen shows ???. One ? for each character. I have tried modifying the menu in C++ using ModifyMenuW. I get more question marks. Visual Studio shows everything working, and the RC file is unicode (UTF-16). I can't easily convert my project to unicode mode. Spanish, French, and German all works fine (one of the Essets in German doesn't work, but that isn't a show stopper). What should I try next?
Thanks in advance!
Well, the easy answer would be change the application to Unicode, but this is not always simple, or possible at all.
Concerning using Unicode in a MBCS application, some things are possible and some others not. For example, I have made a MBCS application displaying and editing translations of program strings (messages, menues etc) in a ListView control, however ListView does have a specific message to turn it to Unicode (LVM_SETUNICODEFORMAT) and support operations (see also CCM_SETUNICODEFORMAT). Menus aren't controls though, but they do have "wide" (Unicode) functions.
If you want to use Unicode in your application, there are some tests you need to make. Success is not guaranteeded, but you can at least draw some conclusions and determine whether what you want to do is possible.
Test1:
You mentioned trying ModifyMenuW(), but this will try to modify an existing menu. Instead, try InsertMenuW() or InsertMenuItemW(). Any unicode string should be displayed properly, so try not just Chinese, but other laguages too (eg Greek or Russian). And btw, I can't see how French works and German doesn't (they use the same codepage - West European). What's the system codepage of your test-machine?
Test2: (if the above has failed)
Try changing the whole menu (SetMenu()) with having a single (unicode) menu item as its root.
Test3: (if the above have failed)
Then you need to check whether the window containing the menu must be Unicode. Create a simple "Hello World" Win32 application, or find a sample, if Visual Studio does not do this for you (these basically register the window class, create the main window and start the message-loop) - you must add a menu too, using the "wide" version of the menu functions explicitly. If this doesn't work, try changing the code that creates the window to unicode. This way you will know whether you need a unicode window, to own the menu.
Please make these tests and let us know the results. I will further post if needed.

Special characters on MFC dialog form

I can see special characters ąęį when I do form design on static text label:
These character are changed while running:
If I set these characters in programming way I have:
How can I ensure that the correct characters are displayed instead of question marks as shown in the screenshot above?
UPD:
My project is Multi-Byte. I found that in another computer I can see special characters. Why?
You need to use Unicode character set for this to work correctly, and my guess is that you're using MBCS character set now.
You could change it in the project properties. Refer to this screenshot:
Visual studio editor is fully Unicode, meaning it could display such special characters as you type when you're designing the dialog. However, if your application is not built with Unicode support, it won't be able to display thsoe characters when it runs. Thich is why you see the ??? replacing the Unicode text when you run the application.
If you get different results on different computers this is obviously due to differences in system settings.
The setting that controls this is called "Language for non-Unicode programs", and can be found under Control Panel, Language, Change date, time or number formats. Unfortunately it's a global setting (ie cannot be set per application or programmatically) and requires a re-boot.
Consider making your application Unicode, if possible (and meaningful cost- or effort-wise).

Sublime Text: ignore double quotes and display correct colors for HTML tags

I used to write HTML attribute values without double quotes. That makes the HTML code look very clean. Take my another answer as an example.
However, such a style causes Sublime to display tag colors incorrectly. In the following picture, since <div id=wrapper> has no double quotes around wrapper, Sublime does not show any color after that line (but how come everything looks OK before that line?).
Is there any way that I can set Sublime to ignore the double quotes and display correct colors?
What you need to do is redefine the syntax definitions in Sublime Text. You can also do this on the user level. Two great resources for doing this are here and here. They're very well written.
With that said, I’m using build 3083 right now and I can’t replicate your issue. A quick update might be all you need. I hope this helps.
Sublime Text has a setting called "HTML/XML Attributes" that can be customized to handle this scenario. You can add the following setting to your Sublime Text user settings file to ignore the double quotes:
Json
"auto_complete_html_attributes": false
This setting will turn off auto-completion for HTML/XML attributes in Sublime Text and allow the display of tag colors correctly. To access the user settings file, go to Preferences > Settings.

Is there a way to change how tab characters are rendered in a browser?

Specifically in Firefox. We look at code in the browser often, and I am wondering if we could configure the browser so that tab characters show up as 4 spaces wide, instead of the default 8 spaces.
Edit: no responses yet. So I assume this is not possible?
Not really the answer you are looking for but maybe you could replace the tab characters with the appropriate amount of spaces and use the "pre" tag?
It is definitely worth looking at the html source to see how sites like stackoverflow.com deal with displaying source code.

apostrophes changes when I copy and paste

When I cut and paste apostrophes between programs (ie. notepad2, notepad++, hiedisql, word, etc etc) and wysiwyg's, and source codes my apostrophe is changing a little. It looks different and it behaves differently depending on the copy source and paste source.
Is this normal? Is there any way to make sure everything renders the apostrophe the same way? is this a windows thing?
I feel like this is a new thing, but maybe it has always been like this.
Do you mean that ’ -- should look like: -- turns into ' ??
If so, your editor program is "helpfully" changing a non-Ascii right apostrophe into the only apostrophe available in Ascii, the "straight" apostrophe: ' (Or vice-versa.)
The right and left apostrophes are defined in Unicode and ISO 8859 character sets, but not Ascii.
Solution Check the docs for your editors to see if you can turn off the behavior. It may not be possible depending on the specific editing software and its version.
Added Even this editor in Stack Overflow caused me some problems: I entered the Unicode right apostrophe, and it looked fine in the editor. But the preview window (and the display of my answer) shows the apostrophe as being a "straight" apostrophe: it appears that the font used by Chrome for displaying and previewing the answer shows a straight apostrophe instead of a right one. So I added a graphic for the right apostrophe.
Blog post about the problem
For writing software, SQL, etc, you should stick to the straight apostrophe. Editors should not convert the straight apostrophe to the right apostrophe. The issues of single quotes (apostrophes) and straight quotes vs opening and closing quotes is a primary difference between a document editor and a code (software) editor. If your editor changes apostrophes and quotes for you, it can cause a lot of problems in your software. You can usually turn off the behavior of "smart quotes" or similar.

Resources