How to set default encoding in Dart Editor? - character-encoding

My HTML5 project has to be fully made in the ISO-8859-2 encoding. Is there any possibility to set the character encoding in the Dart Editor, or I should use another IDE with the Dart plugin?
And for IDEs or editors with the Dart plugin: Does any IDE or editor with the Dart plugin generate the yaml file, compile the .dart file and make dart.js (for web applications)?
Please help!

You can try using the eclipse plugins version of our distribution (https://www.dartlang.org/tools/eclipse-plugin/). You should be able to set the file encoding for all file formats expect for dart files. The Dart language specification does indicate that Dart files should be encoded as UTF8. If you work with them in some other encoding, you run the risk of other consumers of your source files assuming that they're UTF8 encoded, and having trouble reading them and / or munging them on save.

It shouldn't be too difficult to edit the project in UTF-8 but have a deployment step that converts the (non-dart-source) files to 8859-2 with iconv or any number of other utilities. But having an HTML5 project that has to be in a specific encoding seems like a very odd requirement.

Related

What is “Character Encoding” used for in Rational Team Concert?

I’m a bit confused about the “Character Encoding” in Rational Team Concert, while having trouble with UTF-8 encoded files that are now stored in RTC. (I never had any trouble with these files before.)
The “Character Encoding” shows up in the Eclipse client (at least) here:
File Compare.
Jazz SCM Properties.
The “Character Encoding” is not displayed in the Visual Studio RTC client, at least I could not find it. (Of course, VS has its own ways to display and change encoding of files, but these are independent of RTC.)
I saw several files that are version controlled with MIME Type text/plain which have different “Character Encoding”s for nearly every revision, sometimes changing from UTF-8 to Cp1252 back and forth. Usually, only a few lines in a large file are changed.
It seems to me that automatic merge with the Visual Studio client regularly, but not always, gets confused with encoding and/or byte order marks and changes non 7-bit-ASCII characters. I cannot reproduce this.
I learned several things from a good answer:
Encoding isn’t stored on the server, it is client-only.
scm set property file.encoding sets a user property (and this even can be set to random value such as foo). However:
As far as I can see, file.encoding is completely ignored by Visual Studio, although this doc says:
To change the encoding for files that are checked in from the CLI or Rational Team Concert Client for Microsoft Visual Studio IDE, run scm set property [...] Example: scm set property file.encoding UTF-8 path/to/file.
tl;dr: My question is: Is this “Character Encoding” and/or “file.encoding” of any relevance, and if yes, what is it used for?
Following the FAQ, it is used by an RTC Client (Eclipse or VS) at the checkin phase.
If the encoding specified there differs from the one used in the file you want to check-in, there will be an error:
Basically, there is a text file that Jazz attempted to read when checking in the project contents that it could not because the content does not adhere to the encoding rules. The error message should provide you with the name of file that caused the problem.
Within Eclipse, you have a default encoding for text files.
To see what it is, from the toolbar select Windows > Preferences... > General > Workspace.
If this is not the encoding for most of your text files, you should change it here.
When working within a team you should decide upon a common encoding that you and your team will use. That encoding should also be available on the server (for annotate to work well). You will need to communicate with the rest of your team what the encoding is.

How can I use Twitter Bootstrap, MVC and Visual Studio together?

I am starting to try out Bootstrap. I have already downloaded the dotless extension but I am confused as to what to do next. Looking at the bootstrap files I see a lot of .less files. Can someone explain where I should put these within the MVC folder structure and how can I set up the application so that when I make a change to a color variable then my .css files get updated.
Update
As suggested I placed all the .less files in the same directory as my css.
However what should I do next? I tried to view the URL
http://127.255.0.0:82/Content/Stylesheets/bootstrap.less
in my browser but got the following message:
(
Expected '}' but found '~' on line 522 in file 'mixins.less':
[521]: .spanX (#index) when (#index > 0) {
[522]: (~".span#{index}") { .span(#index); }
------^
[523]: .spanX(#index - 1);
I currently compile the less files on build with nodejs.
You need to install node.js.
Once installed, in command prompt type: "npm install less -g" this installs the latest less globally (-g on the end for global).
In visual studio, go to Build Events in the websites properties page and put in a "pre-build event command line" like the following:
lessc $(SolutionDir)path-to-main-less-file.less > $(SolutionDir)path-to-where-css-is-output.css -x
EDIT: Bootstrap now uses Recess and npm command has changed as seen here.
Go easy on me, It's my first post! :)
This is a known issue in Dotless:
https://github.com/dotless/dotless/issues/155
Basically the Bootstrap source code is using LESS features that are not yet supported in the version of Dotless that you use. Apparently support has been added in the latest source though, so you should be able to resolve this by compiling Dotless from the latest source.
It is not enough to download and reference dotless.Core.dll, because the binary files aren't up-to-date enough, i.e. they do not contain the latest features that you need for Bootstrap. Only the source files contain the latest changes, so you have to produce the dotless.Core.dll by compiling the latest source with Visual Studio. Of course these features will be included in the .dll download when they next decide to update it.
Dotless produces the result file bootstrap.css "on the fly". You never see that file on the disk, as it is produced by compiling the .less files when they are requested via HTTP. The CSS that is produced is only cached in memory. However you could always request the .less file in your browser and save what you see to a .css file. That would work but there isn't much point in doing it if your Dotless installation is working properly.
However, if all you want is a bootstrap.css file with your customized values, you can also use this online tool on the Bootstrap website. It will let you change the variable values and download the resulting CSS.
Have you tried Mindscap Web Workbench?
They have an article on how to set it up for use with Twitter Bootstrap.
You can use Combres to with my dotless plugin here. All you need to do is reference bootstrap.less and all the imports will work out of the box with clean Bootstrap less files. Combres will build and cache the bootstrap file and even compress it with other non-Bootstrap css files. This is the ideal setup.
http://pknopf.com/blog/using-less-correctly-with-combres

Java JRE: How to add localized resources to stantard JRE resources

I need the JRE to use translated versions of a JRE resource that is available only in English.
As per the ResourceBundle.java doc, it's easy: add localized resources with the right locale suffix. For example, the standard
XMLSchemaMessages.properties
would become a translated version:
XMLSchemaMessages_FR.properties
And so on.
EDIT: this particular file lives in :
com\sun\org\apache\xerces\internal\impl\msg\XMLSchemaMessages.properties
My question is: how do I make those extra resources visible to the JRE ?
Thanks in advance, for any help.
-- cheers
Assuming that Xerces uses ResourceBundle to get the messages, you should put a new file in
com\sun\org\apache\xerces\internal\impl\msg\XMLSchemaMessages<locale>.properties
where locale is a correct identifier for the locale you need.
Then pinpoint the exact location where the XMLSchemaMessages resource bundle is loaded, and set a breakpoint so you single step through the ResourceBundle loading procedure in the JRE (a JDK is recommended here, so you have source for the runtime) and you can see what is being searched for.
Note: You are dealing with a vendor specific XML Parser here meaning this will be Oracle specific and may even only work on some Java versions. Considered bringing in your own validating XML Parser and localize it instead?
The above answers took me a little while to work out.
Just to make it easier for others, here's my summary of how to get Locale specific error messages to appear if you try parsing an XML document using XML schema with Java's internal Xerces parser:
Find an appropriate properties file in the format
XMLSchemaMessages_<lower_case_language_code>.properties
For Italian I found XMLSchemaMessages_it.properties on the following site (which might be an old version, but it worked for me)
http://grepcode.com/file/repo1.maven.org/maven2/com.sun.xml.parsers/jaxp-ri/1.4.5/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties
I then created a directory structure in my temp directory to hold the new file
com\sun\org\apache\xerces\internal\impl\msg
Since jar files and zip files share the same format (and I'm lazy and today I was using Windows), I then zipped the above com directory, creating a file called com.zip. I then changed the name of the file
rename com.zip to XMLSchemaMessages_Locale.jar
and then moved the new jar file to
C:\Program Files\Java\jdk1.7.0_04\jre\lib\ext
Of course the above path depends on your platform and specific version of Java (I was using Windows 7).
Instead of zipping, if you have JDK you could easily build the jar file using the command-line jar command, from Unix, Linux or Windows.

What is the standard format for localised resource files on different development platforms?

When developing in .Net, the framwork provides resx files as the standard way of storing localised resources (e.g. tranlsations of UI text).
I would like to know if there is a standard format for this in other development platforms (e.g. Java, RoR, etc.) and what that format is.
Thank you!
Please limit each answer to one development technology (e.g Java/C++/PHP etc.)
Java uses Properties, which are key-value pairs.
They can be serialized to the following two formats:
.properties
foo=bar
.XML
<entry key="foo">bar</entry>
Like Java, Adobe Flex also uses ResourceBundles that are serialized to .properties files
See http://www.freebsd.org/doc/en/books/developers-handbook/posix-nls.html
There is a standard, called POSIX, that applies to just about every other non-Windows operating system.
See http://www.php.net/manual/en/book.intl.php for the PHP-specific implementation of internationalization.
Large translation vendors accept the TMX file format for interchange of translation strings. Because they only have to deal with a standard xml file rather than strings embedded in controls, the amount of work these vendors have to do is reduced and so are their fees.
The standard way to do this on Linux is to use the gettext library, which stores its translations in .po files.
Cocoa applications (Mac/iPhone) are distributed as bundles (essentially: folders but with a known file-ish type). Inside a bundle, you can provide copies of strings files or other localized resources in a locale-specific subfolder. The Xcode provides IDE support for this, and the Cocoa frameworks provide many methods to conveniently fetch these resources.
See http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/InternatAndLocaliz.html for details.

What editor do you use for OpenLaszlo coding?

I'm new to developing in OpenLaszlo, and have tried Eclipse (hoping for decent code completion), but found it far too heavy for my tastes. fell back to using Textmate, but the bundle for OpenLaszlo is terribly out of date.
Any suggestions? or should I just roll up my sleeves and write a new bundle for Textmate?
I personally use SpketIDE as an Eclipse plugin. It has some code completion, good syntax highlighting.
I use VIM for this. The VIM mode that ships with OpenLaszlo recognizes both the XML tags and the embedded JavaScript. Of course, if you're not already a VIM user, it's a big project to dive in.
If you use a texteditor or XML editor with support for XSD schema, you can generate a custom XSD file of your application using this OpenLaszlo Schema Generator tool. The tool uses Ant to generate the schema file, which then can be used by the editor of your choice.
We used Visual Studio. And we used it just as a great XML editor.
I also used Notepad2 because it is very lightweight and has syntax highlighting.
I've been using Notepad++ with the XML language chosen (since Open Laszlo is basically just XML and javascript). Simple, but effective and free.
I wouldn't have added it otherwise, but since its arch-enemy VI(m) was mentioned:
Emacs
is worth listing. :)
Without knowing much about OL, I am pretty sure one of gazillions of modes it has provides some level of support for your editing needs.
I've been developing in OpenLaszlo since 2006. I currently use NotePad++ with .lzx files set to be interpreted as XML files, this allows the code to be highlighted well in different colours for the different parts that make up OpenLaszlo code (XML nodes, JavaScript/AS3, etc.).
You can find NotePad++ at:
http://notepad-plus-plus.org/
it is free.
I just test my application by loading it into a web browser page.

Resources