Solved

Convert charset from Mysql table to utf8

Posted on 2010-11-16
4
395 Views
Last Modified: 2012-06-21
Hi!

Have a table in MYSQL that contains of characters that NOT is UTF8.

How do i in vb.net convert this data to UTF8 ??
0
Comment
Question by:team2005
  • 2
4 Comments
 
LVL 6

Expert Comment

by:Codebot
ID: 34145123
Imports System.Text
 
    ...
 
    Public Function StringAsUtf8Bytes(ByVal strData As String) As Byte()
 
        Dim bytes() As Byte
 
        ' get unicode string as bytes
        bytes = Encoding.UTF8.GetBytes(strData)

        ' return byte data
        Return bytes
 
    End Function
0
 
LVL 2

Author Comment

by:team2005
ID: 34153846
Hi!
'
This give me only valuses like 195,155...

Must convert this to string
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34153939
0
 
LVL 2

Author Comment

by:team2005
ID: 34154173
Hi!

I wil try to explane what i want
Have this string from a field in mysql:
"MÃ¥ltrostveien 4"  --> Must be converted to UTF8 like : "Måltrostveien 4"

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question