Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

How to convert all accent char to normal char (Only for win2k)?
[ All Languages » VB »  String]

Total Hit ( 2291)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


This example will show you how to convert all accent characters to normal character.

Step-By-Step Example

- Create a standard exe project
- Add the following code in form1

Click here to copy the following block
Private Declare Function FoldString _
Lib "kernel32" Alias "FoldStringA" ( _
ByVal dwMapFlags As Long, _
ByVal lpSrcStr As String, _
ByVal cchSrc As Long, _
ByVal lpDestStr As String, _
ByVal cchDest As Long) As Long

Private Const MAP_COMPOSITE = &H40
Private Const MAP_EXPAND_LIGATURES = &H2000
Private Const MAP_FOLDCZONE = &H10
Private Const MAP_FOLDDIGITS = &H80
Private Const MAP_PRECOMPOSED = &H20

Public Function SplitAccents(ByVal str As String) As String
  Dim sNew As String
  Dim nLen As Long
  sNew = Space$(Len(str) * 2)
  nLen = FoldString(MAP_COMPOSITE, str, Len(str), sNew, Len(sNew))
  SplitAccents = Left$(sNew, nLen)
End Function

Private Sub Form_Load()
  MsgBox "Input : éàôë"
  MsgBox "Output : " & SplitAccents("éàôë")
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.