Question

I am working on a client application using Eclipse and we are having all kinds of problems committing, merging, comparing, etc. with CVS (I know its CVS but this is bad). I'm thinking that since I am on Windows we are running into issues with line delimiters. Our CVS server runs on Windows (again I know, but comments are welcome to show our current dev environment is broken and I'm not just blowing smoke here).

Currently all of our projects are using Cp1252 with Windows style delimiters. I would like to change the default text file encoding to UTF-8 and UNIX style delimiters, and I was wonderng if someone who has gone through this transition could comment.

Also, since we use WSImport to create our client web services I am trying to figure out what type of line delimiters it uses. Does any one know?

Thanks,

JD

Was it helpful?

Solution

Since for write the Java source codes, wsimport use an instance of java.io.PrintWriter, and each line is write it with the method java.io.PrintWriter.println, this depends of the enviroment.

import com.sun.tools.internal.ws.WsImport;

public class Main {

    static {
        System.getProperties().put("line.separator", "\n"); \\ or "\r\n"
    }

    public static void main(String[] args) throws Throwable {
        WsImport.main("service.wsdl -Xnocompile".split("\\s+"));
    }

}

For the charset, this:

The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system.

You can specified this with the next arg in the virtual machine:

-Dfile.encoding=UTF-8
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top