Greetings,
I use Vault with mono on Fedora Core 2 to primarily develop Java code and I'm having some problems with Mono's handling of UTF-8 files.
Whenever I check in or check out a file from the repository (which runs on Windows 2000 Server), a UTF-8 BOM (hex EF BB BF) is pre-pended to the file. Unfortunately, javac chokes on this since it does not grok UTF-8 with BOMs.
# javac Whello.java
Whello.java:1: 'class' or 'interface' expected
public class Whello
^
Whello.java:1: illegal character: \187
public class Whello
^
Whello.java:1: illegal character: \191
public class Whello
^
3 errors
This is similar to the problem reported in this thread: http://support.sourcegear.com/viewtopic.php?t=1218 , however, in my case the problem occurs for .java extensions.
I've used a perl one-liner to remove the BOM for now, but it'd be great if you could fix this so that I had one less thing to worry about post-checkout.
Thanks,
--Prasenjeet
PS. My machine configuration is:
[/proc]# cat cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : AMD Athlon(tm) XP 2500+
stepping : 0
cpu MHz : 1830.048
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov
pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 3620.86
[/proc]# cat version
Linux version 2.6.5-1.358 (bhcompile@bugs.build.redhat.com) (gcc version 3.3.3
20040412 (Red Hat Linux 3.3.3-7)) #1 Sat May 8 09:04:50 EDT 2004
[~]# java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
[~]# mono -V
Mono JIT compiler version 1.0, (C) 2002-2004 Novell, Inc and Contributors.
www.go-mono.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV : normal
Globalization: ICU
I downloaded the official binary Fedora Core 2 distribution of mono (rpms) 1.0 from www.mono-project.com.
UTF-8 BOM Prefixed to .java files in Mono
Moderator: SourceGear
This is a problem with the way Vault assumes a writable stream will create files under Mono. On Windows, these Unicode headers are parsed correctly when the files are read back (since Windows uses Unicode natively for all files). On Unix, we create streams to write files with the "default" encoding, which mono thinks should be Unicode. This will be fixed in Vault 2.1.
Shaw Terwilliger
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`
SourceGear LLC
`echo sterwill5sourcegear6com | tr 56 @.`