Solved

Convert charset from Mysql table to utf8

Posted on 2010-11-16
4
387 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now