# String to UTF-8

**URL:** <https://forum.kirupa.com/t/string-to-utf-8/316179>\
**Category:** Uncategorized\
**Created:** [November 15, 2010, 11:37am UTC](https://forum.kirupa.com/t/string-to-utf-8/316179 "2010-11-15T11:37:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cystavros](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@cystavros](https://forum.kirupa.com/u/cystavros)\
**Post date:** [November 15, 2010, 11:37am UTC](https://forum.kirupa.com/t/string-to-utf-8/316179/1 "2010-11-15T11:37:58Z")

</div>

hello i try to convert a program from [vb.net](http://vb.net) to flash as3  
and i cannot figure out how to do this

```php

MsgBox(BitConverter.ToString(Encoding.UTF8.GetBytes("CP0809344834")))

```

when i execute tis i get: 43-50-30-38-30-39-33-34-34-38-33-34  
now i wrote this code in AS3

```php

import flash.utils.ByteArray;

var serial = "CP0809344834";

var a:ByteArray = new ByteArray();

a.writeUTF(serial);

trace(a.length);
for (var i:int = 0; i < a.length; i++)
{
trace(a*);	
}

```

but it doesn’t give me the same value  
please help me
