Jetty mac encoding to UTF-8 - macos

I'm running Jetty on OSX on my dev environment. Currently character encoding seems to be faulti (probably mac-roman), overriding Jetty default. How can I force the encoding to be UTF-8? This problem seems to appear only on OSX, linux/windows works fine.
I'm running Jetty from terminal so eclipse-specific solutions aren't of help.

Apparently I was wrong in blaming Jetty for this problem. The reason was maven and how maven brings in the default encoding java-settings.
Setting this env-variable seemed to solve the problem:
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
Answer found from here.

No problem here however we start Jetty from the javaWrapper (and which should not make a difference).
The only parameter I can see making an impact is setting the file.encoding System Property e.g. -Dfile.encoding=UTF-8
EDIT
( our macs locale are set to utf-8 )

To set the default character encoding for jetty you can set the system property 'org.eclipse.jetty.util.UrlEncoding.charset' to whatever you like. This will affect the encoding and decoding for either the query string of a URL or the content of a POST HTTP request.
Also, for a long time (maybe early 6.1.x timeframe) now this has been utf-8 by default so I am not certain this is the issue your are seeing.
So it is clear, jetty has been an eclipse project for a number of years now so that above system settings isn't an eclipse specific setting, it is just an artifact of our being at eclipse naming wise. :)
cheers

Related

Netbeans 8.0.1 not opening on MacOS Mojave

After upgrade to Mojave, Netbeans 8.0.1 is not opening anymore ; it shows the splash screen, but closes right after.
It probably has to be with a JDK update; which JDK version it supports and how can i downgrade the JDK
Thanks !
NetBeans reads a configuration file named netbeans.conf on startup. It is just a text file containing properties, located in its etc directory within the NetBeans installation. One of the properties it might specify is the path to the default JDK to be used via property netbeans_jdkhome.
If that path becomes invalid (e.g. possibly due to upgrading on Mac) then NetBeans won't start; as described in the OP it will display the splash screen then close down.
The solution is simply to edit property netbeans_jdkhome to specify a valid path to the JDK that you want to use.
Note that netbeans_jdkhome is not necessarily specified at all in netbeans.conf, since NetBeans has other ways of determining the default JDK path. But if netbeans_jdkhome is specified it is crucial that the path is valid.

Grails auto-compile on edit

I have been writing grails applications on Windows, and when I am editing the .groovy files and save they are automatically compiled while the application is running and the changes are available without restarting the app. On OSX this is not happening, in neither interactive mode or by starting the application with grails run-app.
Looking up online I couldn't find a reason for this, and also I know other people working on OSX where this feature works.
Any suggestions as to what might cause this?
Grails 2.3.7
OSX 10.9.4
Java 1.7.0_55
If you are not running in forked mode, you will need to specify the -reloading explicitly.
Starting at some point, the initial JVM has reloading disabled and forks a new JVM with options specified in the grails.project.fork = [...] in BuildConfig.groovy.
As an alternative to passing -reloading each time, you can also modify the startGrails script included with the distribution and change the following option to false:
DISABLE_RELOADING=false
For me, the startGrails script is found in the GVM directory at ~/.gvm/grails/2.3.11/bin/startGrails.

spring-mongodb fails to save in UTF-8

We are inserting documents in mongo through spring-mongodb and the mongo-java-driver everything seems to work fine on the program. Accessing the data back through the java driver works fine but doing the same through mongo console breaks the console.
> db.item.find()
error:non ascii character detected
>
I saw there was a JIRA ticket with a similar error but I'm not sure if this problem is just a console proble or there is really something going on the server.
You'll need to make sure that you are running on a UTF-8 enabled build of MongoDB. A common problem apparently is doing a custom build (or running an older build) of MongoDB without UTF-8 support. The 10gen supplied binaries should have this enabled by default. If they do not, this is often the issue.

Using resource bundle with IDEA IDE

I'm using IDEA IDE to create i18n..
I created English version of my property file and then created a Russian one.
But when I run my web application I saw Ïðîñìîòð Íîâîñòè instead of my text in Russian..
Tell me please what was wrong in IDEA IDE or whether there's a bug in resource bundle plugin.
UPDATE
When I write I18n in eclipse and fill in all necessary fields into Russian language in Eclipse resource bundle plugin instead of Russian text I saw something like this u0443u0434u0430u043Bu0438u0442u044C but when I start my app it displays all well..
And when I start project in IDEA IDE with such properties everything works fine..
I am able to recreate your issue using a different language (Chinese) ... I just tried this in my IntelliJ IDEA instance (I am running IntelliJ IDEA 11.1.3).
I have a ResourceBundle and I dropped in Simplified Chinese characters into my Resource Bundle as follows:
messages.properties
user.label=名称
When I ran my Grails app through IDEA, I got characters ?? instead of the Chinese Characters 名称
This is a bug with IntelliJ Resource Bundle Editor. Here is a link to the Issue:
http://youtrack.jetbrains.com/issue/IDEA-90460
I know it does not give you a fix, but at least it explains to you why it is happening and why you do not see the issue with Eclipse.

How to set LOCALE in Windows console

I need to set locale for a single console. I want to build Apache Wicket framework (Maven-based build), but it fails on test which relies on en_US locale.
I don't want to skip tests.
I don't want to skip the particular failing tests.
Is it possible? Or is changing the system-wide locale the only way?
Thanks
Nothing Wicket specific and I have not done this myself. But, a little bit of google led me to this:
Re: maven-surefire-plugin and default locale which again leads to Surefire Plugin Using System Properties.
Hope that helps
Searching for this, showed up this link, which talks about creating an xml file and invoking it from a batch file as described in this link.

Resources