Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Jun 2009 21:31:53 +0000
From:      codesite-noreply@google.com
To:        mono@FreeBSD.org
Subject:   Issue 10 in bsd-sharp: Codepage/Unicode Issue
Message-ID:  <000e0cd2dec6897655046bdcf8b3@google.com>

next in thread | raw e-mail | index | archive | help

Updates:
	Status: WontFix

Comment #4 on issue 10 by romain.tartiere: Codepage/Unicode Issue
http://code.google.com/p/bsd-sharp/issues/detail?id=10

Just setting LANG and LC_ALL I can have the espected result for the  
following program:
{{{
Public Module TestChar
	Public Sub Main(Byval Args as String())
		Console.WriteLine("140={0}", Asc(Chr(140)))
		Console.WriteLine("145={0}", Asc(Chr(145)))
		Console.WriteLine("150={0}", Asc(Chr(150)))
	End Sub
End Module
}}}

{{{
romain@marvin /tmp % LANG=en_US.ISO8859-1 LC_ALL=en_US.ISO8859-1 mono  
foo.exe
140=63
145=63
150=63
}}}

With my default environment (fr_FR.UTF-8) I get:
{{{
romain@marvin /tmp % mono foo.exe
140=50578

Unhandled Exception: System.ArgumentException: Insufficient Space
Parameter name: bytes
   at System.Text.UTF8Encoding.InternalGetBytes (System.Char* chars, Int32  
count, System.Byte* bytes, Int32 bcount, System.Char& leftOver, Boolean  
flush)
[0x00000]
   at System.Text.UTF8Encoding.InternalGetBytes (System.Char[] chars, Int32  
charIndex, Int32 charCount, System.Byte[] bytes, Int32 byteIndex,  
System.Char&
leftOver, Boolean flush) [0x00000]
   at System.Text.UTF8Encoding.GetBytes (System.Char[] chars, Int32  
charIndex, Int32 charCount, System.Byte[] bytes, Int32 byteIndex) [0x00000]
   at Microsoft.VisualBasic.Strings.Asc (Char String) [0x00000]
   at TestChar.Main (System.String[] Args) [0x00000]
}}}

Replacing each `Asc` with `AscW` and `Chr` with `ChrW` I also have a  
consistent output with both modified and default environments:
{{{
romain@marvin /tmp % LANG=C LC_ALL=C mono foo.exe
140=140
145=145
150=150
}}}

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000e0cd2dec6897655046bdcf8b3>