[Mono-list] Encoding Issue .Net vs. Mono
Atsushi Eno
atsushieno at veritas-vos-liberabit.com
Fri Jul 22 08:09:47 EDT 2011
No, not UTF-16. Default encoding is platform dependent. e.g. it is MS932
on my Japanese Windows, Latin1 for those in the U.S., and UTF-8 on
modern Linux desktop like gnome2 or 3.
Atsushi Eno
(2011/07/21 11:47), Pablo Ruiz wrote:
> Mono uses UTF8 as default encoding. .Net uses UTF16
>
> On Thu, Jul 21, 2011 at 8:42 PM, Tim Nelson <nelson.timothy at gmail.com
> <mailto:nelson.timothy at gmail.com>> wrote:
>
> New to Mono, but I am getting a strange result when Encoding bytes and
> returning a string:
>
>
> int n = System.Text.Encoding.Default.GetString(new byte[] { 0,
> 194, 146, 215 }).Length;
>
> On .Net, this returns 4.
> On Mono, this returns 3.
>
> If I change the second byte 194 to 193 ... both systems return 4.
>
> Is this a Mono bug or my lack of experience with encoding? If it is
> a bug, is there a way around this?
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> <mailto:Mono-list at lists.ximian.com>
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
More information about the Mono-list
mailing list