Vba to bulk rename files - Folder and Subfolder as per criteria - Regular Expressions

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
In my personal documents I'm using a sort of Naming Convention where all my files are named as follows yyyy-mm-dd-FileName.xyz

  • The first characters refer to the Last Modified Date that in many cases represent the Creation Date of the file.
  • ".xyz" I don't change it because it is the file extension.
  • I don't keep spaces or any special character such as accents or accented characters.
My wife is also using the same computer and she is generating some files there. But sometimes she forgets about the naming convention and spoils my control. Lol.

I would like your support on how to develop a VBScript that can:

  1. Remove all spaces of the name by replacing it by "-" Character
  2. Replace Accents & Accented Characters for English Equivalent character
  3. Verify if the first 11 Characters of the File Name is following the Rule of the Naming Convention yyyy-mm-dd- based on Last Modified date of the file. If NOT then rename it as per my Naming Convention yyyy-mm-dd-FileName.xyz
Ps.: The script will verify all files inside a folder and inside of its subfolder. C:\Users\Juliano\Documents\MrExcelForumExample
Can someone help me to finish the code below? The idea is use Regular Expression to identify spaces and accented characters and rename the files.


VBA Code:
Option Explicit
Dim FSO As Object, WindowsFolder As Object, FolderFiles As Object, FoundFile As Object
Dim RegularExpression As Object
Dim TargetFolder As String

Sub RenameFilesAsPerCriteria()
    Set FSO = CreateObject("Scripting.FileSystemObject")
    TargetFolder = "C:\Users\Juliano\Documents\MrExcelForumExample"
    Set WindowsFolder = FSO.GetFolder(TargetFolder)
    Set FolderFiles = WindowsFolder.Files
    Set RegularExpression = New RegExp
    RegularExpression.Global = True
    'RegularExpression.Pattern = white spaces, Accents & Accented Characters


    For Each FoundFile In FolderFiles
        If RegularExpression.Test(FoundFile.Name) = True Then
                '1-Remove Whitespaces replacing it by "-" character
                '2-Replace Accents & Accented Characters for English Equivalent character
                '3-Verify if the file name contains the file name convention yyyy-mm-dd-FileName.xyz
                    '  if NOT rename the file accordingly
        Else: End If
    Next
    VerifySubFolders FSO.GetFolder(TargetFolder)
End Sub

Sub VerifySubFolders(Folder)
    Dim Subfolder As Object
    For Each Subfolder In Folder.SubFolders
        Set WindowsFolder = FSO.GetFolder(Subfolder.Path)
        Set FolderFiles = WindowsFolder.Files
        Set RegularExpression = New RegExp
        RegularExpression.Global = True
        RegularExpression.Pattern = white spaces, Accents & Accented Characters

        For Each FoundFile In FolderFiles
            If RegularExpression.Test(FoundFile.Name) = True Then
                '1-Remove Whitespaces replacing it by "-" character
                '2-Replace Accents & Accented Characters for English Equivalent character
                '3-Verify if the file name contains the file name convention yyyy-mm-dd-FileName.xyz
                    '  if NOT rename the file accordingly
            Else: End If
        Next
        VerifySubFolders Subfolder
    Next
End Sub
 

Dan_W

Well-known Member
Joined
Jul 11, 2018
Messages
584
Office Version
  1. 365
Platform
  1. Windows
Thank you, Luthius.

I have another question - so I've pretty much completed 1 or 2 of the three points, and I was thinking about what the final code would need to look like and two things occur to me.
  1. why do you want diacritic replacement code to be in the form a regular expression? As I thought about it - I figured that you would want a regex so as to be able to identify those filename that did not conform to your filename protocol, which I can understand, but it doesn't seem to me to be a workable solution. To the best of my knowledge, a single regular expression would only be usable if you were swapping out the each accented charcter for one replacement - so in your scenario, you could replace any of the upper case accented 'A's with the one 'A', but the VB regex engine wouldn't be able to make multiple replacements from an array of potential characters in a single regex. This means that the solution would need to involve 4 or 5 regular expressions, at which point it's not a particularly efficient mechanism. The solutions that Peter put us onto are all simple character replacements, and I've managed to get that done (thus my question last week) - but then I remembered you wanted to use regular expressions, and I thought I ought to check why first.
  2. does this need to be executed by VBScript? It's possible to use VBS to run macros stored workbooks in the background, so it would be no different for the end-user. I ask because there are a few elements that don't exist in VBScript and although there are workarounds (and I'm not saying it's impossible), I thought I'd just test to see what your thoughts were before I go off in any one direction.
Thanks.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
1- I guess you are right when saying that Regex will only replace all in a once and not multiple times. The best approach, I think, would be a loop identifying the characters I want to replace and replacing them.
2- It can be executed with your approach with a spreadsheet. Using VBScript I would create a Task Schedule with windows but I realise that I can do it with an excel file as well.
 

Dan_W

Well-known Member
Joined
Jul 11, 2018
Messages
584
Office Version
  1. 365
Platform
  1. Windows
Hi. It's a little tricky to test this when I don't have the files to test it against, so I set out below the code as it currently stands. Could you please test it on a dummy folder with dummy files? I think it does everything you want it to, but I ought to point out:

1. the table of diacritics is longer than you need it to be - I thought better to put more in than less in case you need it later. I had to add a few because the original code didn't quite convert them properly.
2. in terms of validating the protocol, this is a bit tricky when I don't know what the non-compliant filenames generally look like. Basically, the process in the code is - it checks if there are any spaces, and replaces them with hyphens; it removes diacritics, and then checks if the start of the file has the formatted last modified date of the file, and if it doesn't, then add it.
3. the code recursively cycles through any and all subfolders of the designated folder.

I suggest putting the code in it's own standard module. You can run the sub with RenameFilesAsPerCriteria. Don't forget to set the folder. Let me know how it works out. There may need to be some optimisation. Let me know if you need help with the executing VBScript.

VBA Code:
Dim tblRemoveDiacriticsChars(1 To 567) As String
Dim tblRemoveDiacriticsCodes(1 To 567) As String

Sub RenameFilesAsPerCriteria()
     LoadRemoveDiacriticsTables
    Dim Target As Object, FolderName As String, FSO As Object
    
    FolderName = "C:\Users\Juliano\Documents\MrExcelForumExample"
    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set Target = FSO.GetFolder(FolderName)
    
    ProcessFolder Target

End Sub
Sub ProcessFolder(TargetFolder As Object)
    
    Dim SubFolder As Object, File As Object, FormattedDate As String
    
    For Each File In TargetFolder.Files
        ' Check for any spaces in the filename, and replace with hyphens if necessary.
        If InStr(File.Name, Chr(32)) Then File.Name = Replace(File.Name, Chr(32), "-")
        
        ' Remove diacritics from filename
        File.Name = RemoveDiacritics(File.Name)
        
        ' Establish the Last Modified Date of the file and check if
        ' this formatted date is already part of the filename. If not, add it.
        FormattedDate = Format(FileDateTime(File.Path), "yyyy-mm-dd")
        If Left(File.Name, 10) <> FormattedDate Then File.Name = FormattedDate & "-" & File.Name
    
    Next
    
    ' Recursive - Process any subfolders
    For Each SubFolder In TargetFolder.SubFolders
        ProcessFolder SubFolder
    Next
    
End Sub
Function RemoveDiacritics(Filename As String) As String
    ' Load the diacritics and corresponding codes into memory
        
    Dim tmpSource As String, i As Long, lCode As Long, lIndex As Long
    tmpSource = Filename
    
    For i = 1 To Len(tmpSource)
        lCode = AscW(Mid(tmpSource, i, 1))
        lIndex = CharMatch(lCode)
        If lIndex > 0 Then Mid(tmpSource, i, 1) = tblRemoveDiacriticsChars(lIndex)
    Next
    
    RemoveDiacritics = tmpSource
    
End Function
Function CharMatch(Diacritic) As Long
    Dim i As Long
    For i = LBound(tblRemoveDiacriticsCodes) To UBound(tblRemoveDiacriticsCodes)
        If Diacritic = tblRemoveDiacriticsCodes(i) Then
            CharMatch = i
            Exit Function
        End If
    Next
End Function
Sub LoadRemoveDiacriticsTables()
    tblRemoveDiacriticsCodes(1) = &HE0:          tblRemoveDiacriticsChars(1) = "a"
    tblRemoveDiacriticsCodes(2) = &HE1:          tblRemoveDiacriticsChars(2) = "a"
    tblRemoveDiacriticsCodes(3) = &HE2:          tblRemoveDiacriticsChars(3) = "a"
    tblRemoveDiacriticsCodes(4) = &HE3:          tblRemoveDiacriticsChars(4) = "a"
    tblRemoveDiacriticsCodes(5) = &HE4:          tblRemoveDiacriticsChars(5) = "a"
    tblRemoveDiacriticsCodes(6) = &HE5:          tblRemoveDiacriticsChars(6) = "a"
    tblRemoveDiacriticsCodes(7) = &H101:         tblRemoveDiacriticsChars(7) = "a"
    tblRemoveDiacriticsCodes(8) = &H103:         tblRemoveDiacriticsChars(8) = "a"
    tblRemoveDiacriticsCodes(9) = &H105:         tblRemoveDiacriticsChars(9) = "a"
    tblRemoveDiacriticsCodes(10) = &H1CE:         tblRemoveDiacriticsChars(10) = "a"
    tblRemoveDiacriticsCodes(11) = &H1DF:         tblRemoveDiacriticsChars(11) = "a"
    tblRemoveDiacriticsCodes(12) = &H1E1:         tblRemoveDiacriticsChars(12) = "a"
    tblRemoveDiacriticsCodes(13) = &H1FB:         tblRemoveDiacriticsChars(13) = "a"
    tblRemoveDiacriticsCodes(14) = &H201:         tblRemoveDiacriticsChars(14) = "a"
    tblRemoveDiacriticsCodes(15) = &H203:         tblRemoveDiacriticsChars(15) = "a"
    tblRemoveDiacriticsCodes(16) = &H227:         tblRemoveDiacriticsChars(16) = "a"
    tblRemoveDiacriticsCodes(17) = &H1E01:        tblRemoveDiacriticsChars(17) = "a"
    tblRemoveDiacriticsCodes(18) = &H1E9A:        tblRemoveDiacriticsChars(18) = "a"
    tblRemoveDiacriticsCodes(19) = &H1EA1:        tblRemoveDiacriticsChars(19) = "a"
    tblRemoveDiacriticsCodes(20) = &H1EA3:        tblRemoveDiacriticsChars(20) = "a"
    tblRemoveDiacriticsCodes(21) = &H1EA5:        tblRemoveDiacriticsChars(21) = "a"
    tblRemoveDiacriticsCodes(22) = &H1EA7:        tblRemoveDiacriticsChars(22) = "a"
    tblRemoveDiacriticsCodes(23) = &H1EA9:        tblRemoveDiacriticsChars(23) = "a"
    tblRemoveDiacriticsCodes(24) = &H1EAB:        tblRemoveDiacriticsChars(24) = "a"
    tblRemoveDiacriticsCodes(25) = &H1EAD:        tblRemoveDiacriticsChars(25) = "a"
    tblRemoveDiacriticsCodes(26) = &H1EAF:        tblRemoveDiacriticsChars(26) = "a"
    tblRemoveDiacriticsCodes(27) = &H1EB1:        tblRemoveDiacriticsChars(27) = "a"
    tblRemoveDiacriticsCodes(28) = &H1EB3:        tblRemoveDiacriticsChars(28) = "a"
    tblRemoveDiacriticsCodes(29) = &H1EB5:        tblRemoveDiacriticsChars(29) = "a"
    tblRemoveDiacriticsCodes(30) = &H1EB7:        tblRemoveDiacriticsChars(30) = "a"
    tblRemoveDiacriticsCodes(31) = &HC0:          tblRemoveDiacriticsChars(31) = "A"
    tblRemoveDiacriticsCodes(32) = &HC1:          tblRemoveDiacriticsChars(32) = "A"
    tblRemoveDiacriticsCodes(33) = &HC2:          tblRemoveDiacriticsChars(33) = "A"
    tblRemoveDiacriticsCodes(34) = &HC3:          tblRemoveDiacriticsChars(34) = "A"
    tblRemoveDiacriticsCodes(35) = &HC4:          tblRemoveDiacriticsChars(35) = "A"
    tblRemoveDiacriticsCodes(36) = &HC5:          tblRemoveDiacriticsChars(36) = "A"
    tblRemoveDiacriticsCodes(37) = &H100:         tblRemoveDiacriticsChars(37) = "A"
    tblRemoveDiacriticsCodes(38) = &H102:         tblRemoveDiacriticsChars(38) = "A"
    tblRemoveDiacriticsCodes(39) = &H104:         tblRemoveDiacriticsChars(39) = "A"
    tblRemoveDiacriticsCodes(40) = &H1CD:         tblRemoveDiacriticsChars(40) = "A"
    tblRemoveDiacriticsCodes(41) = &H1DE:         tblRemoveDiacriticsChars(41) = "A"
    tblRemoveDiacriticsCodes(42) = &H1E0:         tblRemoveDiacriticsChars(42) = "A"
    tblRemoveDiacriticsCodes(43) = &H1FA:         tblRemoveDiacriticsChars(43) = "A"
    tblRemoveDiacriticsCodes(44) = &H200:         tblRemoveDiacriticsChars(44) = "A"
    tblRemoveDiacriticsCodes(45) = &H202:         tblRemoveDiacriticsChars(45) = "A"
    tblRemoveDiacriticsCodes(46) = &H226:         tblRemoveDiacriticsChars(46) = "A"
    tblRemoveDiacriticsCodes(47) = &H23A:         tblRemoveDiacriticsChars(47) = "A"
    tblRemoveDiacriticsCodes(48) = &H1E00:        tblRemoveDiacriticsChars(48) = "A"
    tblRemoveDiacriticsCodes(49) = &H1EA0:        tblRemoveDiacriticsChars(49) = "A"
    tblRemoveDiacriticsCodes(50) = &H1EA2:        tblRemoveDiacriticsChars(50) = "A"
    tblRemoveDiacriticsCodes(51) = &H1EA4:        tblRemoveDiacriticsChars(51) = "A"
    tblRemoveDiacriticsCodes(52) = &H1EA6:        tblRemoveDiacriticsChars(52) = "A"
    tblRemoveDiacriticsCodes(53) = &H1EA8:        tblRemoveDiacriticsChars(53) = "A"
    tblRemoveDiacriticsCodes(54) = &H1EAA:        tblRemoveDiacriticsChars(54) = "A"
    tblRemoveDiacriticsCodes(55) = &H1EAC:        tblRemoveDiacriticsChars(55) = "A"
    tblRemoveDiacriticsCodes(56) = &H1EAE:        tblRemoveDiacriticsChars(56) = "A"
    tblRemoveDiacriticsCodes(57) = &H1EB0:        tblRemoveDiacriticsChars(57) = "A"
    tblRemoveDiacriticsCodes(58) = &H1EB2:        tblRemoveDiacriticsChars(58) = "A"
    tblRemoveDiacriticsCodes(59) = &H1EB4:        tblRemoveDiacriticsChars(59) = "A"
    tblRemoveDiacriticsCodes(60) = &H1EB6:        tblRemoveDiacriticsChars(60) = "A"
    tblRemoveDiacriticsCodes(61) = &H180:         tblRemoveDiacriticsChars(61) = "b"
    tblRemoveDiacriticsCodes(62) = &H183:         tblRemoveDiacriticsChars(62) = "b"
    tblRemoveDiacriticsCodes(63) = &H1E03:        tblRemoveDiacriticsChars(63) = "b"
    tblRemoveDiacriticsCodes(64) = &H1E05:        tblRemoveDiacriticsChars(64) = "b"
    tblRemoveDiacriticsCodes(65) = &H1E07:        tblRemoveDiacriticsChars(65) = "b"
    tblRemoveDiacriticsCodes(66) = &H181:         tblRemoveDiacriticsChars(66) = "B"
    tblRemoveDiacriticsCodes(67) = &H182:         tblRemoveDiacriticsChars(67) = "B"
    tblRemoveDiacriticsCodes(68) = &H243:         tblRemoveDiacriticsChars(68) = "B"
    tblRemoveDiacriticsCodes(69) = &H1E02:        tblRemoveDiacriticsChars(69) = "B"
    tblRemoveDiacriticsCodes(70) = &H1E04:        tblRemoveDiacriticsChars(70) = "B"
    tblRemoveDiacriticsCodes(71) = &H1E06:        tblRemoveDiacriticsChars(71) = "B"
    tblRemoveDiacriticsCodes(72) = &HE7:          tblRemoveDiacriticsChars(72) = "c"
    tblRemoveDiacriticsCodes(73) = &H107:         tblRemoveDiacriticsChars(73) = "c"
    tblRemoveDiacriticsCodes(74) = &H109:         tblRemoveDiacriticsChars(74) = "c"
    tblRemoveDiacriticsCodes(75) = &H10B:         tblRemoveDiacriticsChars(75) = "c"
    tblRemoveDiacriticsCodes(76) = &H10D:         tblRemoveDiacriticsChars(76) = "c"
    tblRemoveDiacriticsCodes(77) = &H188:         tblRemoveDiacriticsChars(77) = "c"
    tblRemoveDiacriticsCodes(78) = &H23C:         tblRemoveDiacriticsChars(78) = "c"
    tblRemoveDiacriticsCodes(79) = &H1E09:        tblRemoveDiacriticsChars(79) = "c"
    tblRemoveDiacriticsCodes(80) = &HC7:          tblRemoveDiacriticsChars(80) = "C"
    tblRemoveDiacriticsCodes(81) = &H106:         tblRemoveDiacriticsChars(81) = "C"
    tblRemoveDiacriticsCodes(82) = &H108:         tblRemoveDiacriticsChars(82) = "C"
    tblRemoveDiacriticsCodes(83) = &H10A:         tblRemoveDiacriticsChars(83) = "C"
    tblRemoveDiacriticsCodes(84) = &H10C:         tblRemoveDiacriticsChars(84) = "C"
    tblRemoveDiacriticsCodes(85) = &H187:         tblRemoveDiacriticsChars(85) = "C"
    tblRemoveDiacriticsCodes(86) = &H23B:         tblRemoveDiacriticsChars(86) = "C"
    tblRemoveDiacriticsCodes(87) = &H1E08:        tblRemoveDiacriticsChars(87) = "C"
    tblRemoveDiacriticsCodes(88) = &H10F:         tblRemoveDiacriticsChars(88) = "d"
    tblRemoveDiacriticsCodes(89) = &H111:         tblRemoveDiacriticsChars(89) = "d"
    tblRemoveDiacriticsCodes(90) = &H18C:         tblRemoveDiacriticsChars(90) = "d"
    tblRemoveDiacriticsCodes(91) = &H221:         tblRemoveDiacriticsChars(91) = "d"
    tblRemoveDiacriticsCodes(92) = &H1E0B:        tblRemoveDiacriticsChars(92) = "d"
    tblRemoveDiacriticsCodes(93) = &H1E0D:        tblRemoveDiacriticsChars(93) = "d"
    tblRemoveDiacriticsCodes(94) = &H1E0F:        tblRemoveDiacriticsChars(94) = "d"
    tblRemoveDiacriticsCodes(95) = &H1E11:        tblRemoveDiacriticsChars(95) = "d"
    tblRemoveDiacriticsCodes(96) = &H1E13:        tblRemoveDiacriticsChars(96) = "d"
    tblRemoveDiacriticsCodes(97) = &H10E:         tblRemoveDiacriticsChars(97) = "D"
    tblRemoveDiacriticsCodes(98) = &H110:         tblRemoveDiacriticsChars(98) = "D"
    tblRemoveDiacriticsCodes(99) = &H18A:         tblRemoveDiacriticsChars(99) = "D"
    tblRemoveDiacriticsCodes(100) = &H18B:         tblRemoveDiacriticsChars(100) = "D"
    tblRemoveDiacriticsCodes(101) = &H1C5:         tblRemoveDiacriticsChars(101) = "d"
    tblRemoveDiacriticsCodes(102) = &H1F2:         tblRemoveDiacriticsChars(102) = "d"
    tblRemoveDiacriticsCodes(103) = &H1E0A:        tblRemoveDiacriticsChars(103) = "D"
    tblRemoveDiacriticsCodes(104) = &H1E0C:        tblRemoveDiacriticsChars(104) = "D"
    tblRemoveDiacriticsCodes(105) = &H1E0E:        tblRemoveDiacriticsChars(105) = "D"
    tblRemoveDiacriticsCodes(106) = &H1E10:        tblRemoveDiacriticsChars(106) = "D"
    tblRemoveDiacriticsCodes(107) = &H1E12:        tblRemoveDiacriticsChars(107) = "D"
    tblRemoveDiacriticsCodes(108) = &HE8:          tblRemoveDiacriticsChars(108) = "e"
    tblRemoveDiacriticsCodes(109) = &HE9:          tblRemoveDiacriticsChars(109) = "e"
    tblRemoveDiacriticsCodes(110) = &HEA:          tblRemoveDiacriticsChars(110) = "e"
    tblRemoveDiacriticsCodes(111) = &HEB:          tblRemoveDiacriticsChars(111) = "e"
    tblRemoveDiacriticsCodes(112) = &H113:         tblRemoveDiacriticsChars(112) = "e"
    tblRemoveDiacriticsCodes(113) = &H115:         tblRemoveDiacriticsChars(113) = "e"
    tblRemoveDiacriticsCodes(114) = &H117:         tblRemoveDiacriticsChars(114) = "e"
    tblRemoveDiacriticsCodes(115) = &H119:         tblRemoveDiacriticsChars(115) = "e"
    tblRemoveDiacriticsCodes(116) = &H11B:         tblRemoveDiacriticsChars(116) = "e"
    tblRemoveDiacriticsCodes(117) = &H205:         tblRemoveDiacriticsChars(117) = "e"
    tblRemoveDiacriticsCodes(118) = &H207:         tblRemoveDiacriticsChars(118) = "e"
    tblRemoveDiacriticsCodes(119) = &H229:         tblRemoveDiacriticsChars(119) = "e"
    tblRemoveDiacriticsCodes(120) = &H247:         tblRemoveDiacriticsChars(120) = "e"
    tblRemoveDiacriticsCodes(121) = &H1E15:        tblRemoveDiacriticsChars(121) = "e"
    tblRemoveDiacriticsCodes(122) = &H1E17:        tblRemoveDiacriticsChars(122) = "e"
    tblRemoveDiacriticsCodes(123) = &H1E19:        tblRemoveDiacriticsChars(123) = "e"
    tblRemoveDiacriticsCodes(124) = &H1E1B:        tblRemoveDiacriticsChars(124) = "e"
    tblRemoveDiacriticsCodes(125) = &H1E1D:        tblRemoveDiacriticsChars(125) = "e"
    tblRemoveDiacriticsCodes(126) = &H1EB9:        tblRemoveDiacriticsChars(126) = "e"
    tblRemoveDiacriticsCodes(127) = &H1EBB:        tblRemoveDiacriticsChars(127) = "e"
    tblRemoveDiacriticsCodes(128) = &H1EBD:        tblRemoveDiacriticsChars(128) = "e"
    tblRemoveDiacriticsCodes(129) = &H1EBF:        tblRemoveDiacriticsChars(129) = "e"
    tblRemoveDiacriticsCodes(130) = &H1EC1:        tblRemoveDiacriticsChars(130) = "e"
    tblRemoveDiacriticsCodes(131) = &H1EC3:        tblRemoveDiacriticsChars(131) = "e"
    tblRemoveDiacriticsCodes(132) = &H1EC5:        tblRemoveDiacriticsChars(132) = "e"
    tblRemoveDiacriticsCodes(133) = &H1EC7:        tblRemoveDiacriticsChars(133) = "e"
    tblRemoveDiacriticsCodes(134) = &HC8:          tblRemoveDiacriticsChars(134) = "E"
    tblRemoveDiacriticsCodes(135) = &HC9:          tblRemoveDiacriticsChars(135) = "E"
    tblRemoveDiacriticsCodes(136) = &HCA:          tblRemoveDiacriticsChars(136) = "E"
    tblRemoveDiacriticsCodes(137) = &HCB:          tblRemoveDiacriticsChars(137) = "E"
    tblRemoveDiacriticsCodes(138) = &H112:         tblRemoveDiacriticsChars(138) = "E"
    tblRemoveDiacriticsCodes(139) = &H114:         tblRemoveDiacriticsChars(139) = "E"
    tblRemoveDiacriticsCodes(140) = &H116:         tblRemoveDiacriticsChars(140) = "E"
    tblRemoveDiacriticsCodes(141) = &H118:         tblRemoveDiacriticsChars(141) = "E"
    tblRemoveDiacriticsCodes(142) = &H11A:         tblRemoveDiacriticsChars(142) = "E"
    tblRemoveDiacriticsCodes(143) = &H204:         tblRemoveDiacriticsChars(143) = "E"
    tblRemoveDiacriticsCodes(144) = &H206:         tblRemoveDiacriticsChars(144) = "E"
    tblRemoveDiacriticsCodes(145) = &H228:         tblRemoveDiacriticsChars(145) = "E"
    tblRemoveDiacriticsCodes(146) = &H246:         tblRemoveDiacriticsChars(146) = "E"
    tblRemoveDiacriticsCodes(147) = &H1E14:        tblRemoveDiacriticsChars(147) = "E"
    tblRemoveDiacriticsCodes(148) = &H1E16:        tblRemoveDiacriticsChars(148) = "E"
    tblRemoveDiacriticsCodes(149) = &H1E18:        tblRemoveDiacriticsChars(149) = "E"
    tblRemoveDiacriticsCodes(150) = &H1E1A:        tblRemoveDiacriticsChars(150) = "E"
    tblRemoveDiacriticsCodes(151) = &H1E1C:        tblRemoveDiacriticsChars(151) = "E"
    tblRemoveDiacriticsCodes(152) = &H1EB8:        tblRemoveDiacriticsChars(152) = "E"
    tblRemoveDiacriticsCodes(153) = &H1EBA:        tblRemoveDiacriticsChars(153) = "E"
    tblRemoveDiacriticsCodes(154) = &H1EBC:        tblRemoveDiacriticsChars(154) = "E"
    tblRemoveDiacriticsCodes(155) = &H1EBE:        tblRemoveDiacriticsChars(155) = "E"
    tblRemoveDiacriticsCodes(156) = &H1EC0:        tblRemoveDiacriticsChars(156) = "E"
    tblRemoveDiacriticsCodes(157) = &H1EC2:        tblRemoveDiacriticsChars(157) = "E"
    tblRemoveDiacriticsCodes(158) = &H1EC4:        tblRemoveDiacriticsChars(158) = "E"
    tblRemoveDiacriticsCodes(159) = &H1EC6:        tblRemoveDiacriticsChars(159) = "E"
    tblRemoveDiacriticsCodes(160) = &H192:         tblRemoveDiacriticsChars(160) = "f"
    tblRemoveDiacriticsCodes(161) = &H1E1F:        tblRemoveDiacriticsChars(161) = "f"
    tblRemoveDiacriticsCodes(162) = &H191:         tblRemoveDiacriticsChars(162) = "F"
    tblRemoveDiacriticsCodes(163) = &H1E1E:        tblRemoveDiacriticsChars(163) = "F"
    tblRemoveDiacriticsCodes(164) = &H11D:         tblRemoveDiacriticsChars(164) = "g"
    tblRemoveDiacriticsCodes(165) = &H11F:         tblRemoveDiacriticsChars(165) = "g"
    tblRemoveDiacriticsCodes(166) = &H121:         tblRemoveDiacriticsChars(166) = "g"
    tblRemoveDiacriticsCodes(167) = &H123:         tblRemoveDiacriticsChars(167) = "g"
    tblRemoveDiacriticsCodes(168) = &H1E5:         tblRemoveDiacriticsChars(168) = "g"
    tblRemoveDiacriticsCodes(169) = &H1E7:         tblRemoveDiacriticsChars(169) = "g"
    tblRemoveDiacriticsCodes(170) = &H1F5:         tblRemoveDiacriticsChars(170) = "g"
    tblRemoveDiacriticsCodes(171) = &H1E21:        tblRemoveDiacriticsChars(171) = "g"
    tblRemoveDiacriticsCodes(172) = &H11C:         tblRemoveDiacriticsChars(172) = "G"
    tblRemoveDiacriticsCodes(173) = &H11E:         tblRemoveDiacriticsChars(173) = "G"
    tblRemoveDiacriticsCodes(174) = &H120:         tblRemoveDiacriticsChars(174) = "G"
    tblRemoveDiacriticsCodes(175) = &H122:         tblRemoveDiacriticsChars(175) = "G"
    tblRemoveDiacriticsCodes(176) = &H193:         tblRemoveDiacriticsChars(176) = "G"
    tblRemoveDiacriticsCodes(177) = &H1E4:         tblRemoveDiacriticsChars(177) = "G"
    tblRemoveDiacriticsCodes(178) = &H1E6:         tblRemoveDiacriticsChars(178) = "G"
    tblRemoveDiacriticsCodes(179) = &H1F4:         tblRemoveDiacriticsChars(179) = "G"
    tblRemoveDiacriticsCodes(180) = &H1E20:        tblRemoveDiacriticsChars(180) = "G"
    tblRemoveDiacriticsCodes(181) = &H125:         tblRemoveDiacriticsChars(181) = "h"
    tblRemoveDiacriticsCodes(182) = &H127:         tblRemoveDiacriticsChars(182) = "h"
    tblRemoveDiacriticsCodes(183) = &H21F:         tblRemoveDiacriticsChars(183) = "h"
    tblRemoveDiacriticsCodes(184) = &H1E23:        tblRemoveDiacriticsChars(184) = "h"
    tblRemoveDiacriticsCodes(185) = &H1E25:        tblRemoveDiacriticsChars(185) = "h"
    tblRemoveDiacriticsCodes(186) = &H1E27:        tblRemoveDiacriticsChars(186) = "h"
    tblRemoveDiacriticsCodes(187) = &H1E29:        tblRemoveDiacriticsChars(187) = "h"
    tblRemoveDiacriticsCodes(188) = &H1E2B:        tblRemoveDiacriticsChars(188) = "h"
    tblRemoveDiacriticsCodes(189) = &H1E96:        tblRemoveDiacriticsChars(189) = "h"
    tblRemoveDiacriticsCodes(190) = &H124:         tblRemoveDiacriticsChars(190) = "H"
    tblRemoveDiacriticsCodes(191) = &H126:         tblRemoveDiacriticsChars(191) = "H"
    tblRemoveDiacriticsCodes(192) = &H21E:         tblRemoveDiacriticsChars(192) = "H"
    tblRemoveDiacriticsCodes(193) = &H1E22:        tblRemoveDiacriticsChars(193) = "H"
    tblRemoveDiacriticsCodes(194) = &H1E24:        tblRemoveDiacriticsChars(194) = "H"
    tblRemoveDiacriticsCodes(195) = &H1E26:        tblRemoveDiacriticsChars(195) = "H"
    tblRemoveDiacriticsCodes(196) = &H1E28:        tblRemoveDiacriticsChars(196) = "H"
    tblRemoveDiacriticsCodes(197) = &H1E2A:        tblRemoveDiacriticsChars(197) = "H"
    tblRemoveDiacriticsCodes(198) = &HEC:          tblRemoveDiacriticsChars(198) = "i"
    tblRemoveDiacriticsCodes(199) = &HED:          tblRemoveDiacriticsChars(199) = "i"
    tblRemoveDiacriticsCodes(200) = &HEE:          tblRemoveDiacriticsChars(200) = "i"
    tblRemoveDiacriticsCodes(201) = &HEF:          tblRemoveDiacriticsChars(201) = "i"
    tblRemoveDiacriticsCodes(202) = &H129:         tblRemoveDiacriticsChars(202) = "i"
    tblRemoveDiacriticsCodes(203) = &H12B:         tblRemoveDiacriticsChars(203) = "i"
    tblRemoveDiacriticsCodes(204) = &H12D:         tblRemoveDiacriticsChars(204) = "i"
    tblRemoveDiacriticsCodes(205) = &H12F:         tblRemoveDiacriticsChars(205) = "i"
    tblRemoveDiacriticsCodes(206) = &H1D0:         tblRemoveDiacriticsChars(206) = "i"
    tblRemoveDiacriticsCodes(207) = &H209:         tblRemoveDiacriticsChars(207) = "i"
    tblRemoveDiacriticsCodes(208) = &H20B:         tblRemoveDiacriticsChars(208) = "i"
    tblRemoveDiacriticsCodes(209) = &H1E2D:        tblRemoveDiacriticsChars(209) = "i"
    tblRemoveDiacriticsCodes(210) = &H1E2F:        tblRemoveDiacriticsChars(210) = "i"
    tblRemoveDiacriticsCodes(211) = &H1EC9:        tblRemoveDiacriticsChars(211) = "i"
    tblRemoveDiacriticsCodes(212) = &H1ECB:        tblRemoveDiacriticsChars(212) = "i"
    tblRemoveDiacriticsCodes(213) = &HCC:          tblRemoveDiacriticsChars(213) = "I"
    tblRemoveDiacriticsCodes(214) = &HCD:          tblRemoveDiacriticsChars(214) = "I"
    tblRemoveDiacriticsCodes(215) = &HCE:          tblRemoveDiacriticsChars(215) = "I"
    tblRemoveDiacriticsCodes(216) = &HCF:          tblRemoveDiacriticsChars(216) = "I"
    tblRemoveDiacriticsCodes(217) = &H128:         tblRemoveDiacriticsChars(217) = "I"
    tblRemoveDiacriticsCodes(218) = &H12A:         tblRemoveDiacriticsChars(218) = "I"
    tblRemoveDiacriticsCodes(219) = &H12C:         tblRemoveDiacriticsChars(219) = "I"
    tblRemoveDiacriticsCodes(220) = &H12E:         tblRemoveDiacriticsChars(220) = "I"
    tblRemoveDiacriticsCodes(221) = &H130:         tblRemoveDiacriticsChars(221) = "I"
    tblRemoveDiacriticsCodes(222) = &H197:         tblRemoveDiacriticsChars(222) = "I"
    tblRemoveDiacriticsCodes(223) = &H1CF:         tblRemoveDiacriticsChars(223) = "I"
    tblRemoveDiacriticsCodes(224) = &H208:         tblRemoveDiacriticsChars(224) = "I"
    tblRemoveDiacriticsCodes(225) = &H20A:         tblRemoveDiacriticsChars(225) = "I"
    tblRemoveDiacriticsCodes(226) = &H1E2C:        tblRemoveDiacriticsChars(226) = "I"
    tblRemoveDiacriticsCodes(227) = &H1E2E:        tblRemoveDiacriticsChars(227) = "I"
    tblRemoveDiacriticsCodes(228) = &H1EC8:        tblRemoveDiacriticsChars(228) = "I"
    tblRemoveDiacriticsCodes(229) = &H1ECA:        tblRemoveDiacriticsChars(229) = "I"
    tblRemoveDiacriticsCodes(230) = &H135:         tblRemoveDiacriticsChars(230) = "j"
    tblRemoveDiacriticsCodes(231) = &H1F0:         tblRemoveDiacriticsChars(231) = "j"
    tblRemoveDiacriticsCodes(232) = &H249:         tblRemoveDiacriticsChars(232) = "j"
    tblRemoveDiacriticsCodes(233) = &H134:         tblRemoveDiacriticsChars(233) = "J"
    tblRemoveDiacriticsCodes(234) = &H248:         tblRemoveDiacriticsChars(234) = "J"
    tblRemoveDiacriticsCodes(235) = &H137:         tblRemoveDiacriticsChars(235) = "k"
    tblRemoveDiacriticsCodes(236) = &H199:         tblRemoveDiacriticsChars(236) = "k"
    tblRemoveDiacriticsCodes(237) = &H1E9:         tblRemoveDiacriticsChars(237) = "k"
    tblRemoveDiacriticsCodes(238) = &H1E31:        tblRemoveDiacriticsChars(238) = "k"
    tblRemoveDiacriticsCodes(239) = &H1E33:        tblRemoveDiacriticsChars(239) = "k"
    tblRemoveDiacriticsCodes(240) = &H1E35:        tblRemoveDiacriticsChars(240) = "k"
    tblRemoveDiacriticsCodes(241) = &H136:         tblRemoveDiacriticsChars(241) = "K"
    tblRemoveDiacriticsCodes(242) = &H198:         tblRemoveDiacriticsChars(242) = "K"
    tblRemoveDiacriticsCodes(243) = &H1E8:         tblRemoveDiacriticsChars(243) = "K"
    tblRemoveDiacriticsCodes(244) = &H1E30:        tblRemoveDiacriticsChars(244) = "K"
    tblRemoveDiacriticsCodes(245) = &H1E32:        tblRemoveDiacriticsChars(245) = "K"
    tblRemoveDiacriticsCodes(246) = &H1E34:        tblRemoveDiacriticsChars(246) = "K"
    tblRemoveDiacriticsCodes(247) = &H13A:         tblRemoveDiacriticsChars(247) = "l"
    tblRemoveDiacriticsCodes(248) = &H13C:         tblRemoveDiacriticsChars(248) = "l"
    tblRemoveDiacriticsCodes(249) = &H13E:         tblRemoveDiacriticsChars(249) = "l"
    tblRemoveDiacriticsCodes(250) = &H140:         tblRemoveDiacriticsChars(250) = "l"
    tblRemoveDiacriticsCodes(251) = &H142:         tblRemoveDiacriticsChars(251) = "l"
    tblRemoveDiacriticsCodes(252) = &H19A:         tblRemoveDiacriticsChars(252) = "l"
    tblRemoveDiacriticsCodes(253) = &H234:         tblRemoveDiacriticsChars(253) = "l"
    tblRemoveDiacriticsCodes(254) = &H1E37:        tblRemoveDiacriticsChars(254) = "l"
    tblRemoveDiacriticsCodes(255) = &H1E39:        tblRemoveDiacriticsChars(255) = "l"
    tblRemoveDiacriticsCodes(256) = &H1E3B:        tblRemoveDiacriticsChars(256) = "l"
    tblRemoveDiacriticsCodes(257) = &H1E3D:        tblRemoveDiacriticsChars(257) = "l"
    tblRemoveDiacriticsCodes(258) = &H139:         tblRemoveDiacriticsChars(258) = "L"
    tblRemoveDiacriticsCodes(259) = &H13B:         tblRemoveDiacriticsChars(259) = "L"
    tblRemoveDiacriticsCodes(260) = &H13D:         tblRemoveDiacriticsChars(260) = "L"
    tblRemoveDiacriticsCodes(261) = &H13F:         tblRemoveDiacriticsChars(261) = "L"
    tblRemoveDiacriticsCodes(262) = &H141:         tblRemoveDiacriticsChars(262) = "L"
    tblRemoveDiacriticsCodes(263) = &H1C8:         tblRemoveDiacriticsChars(263) = "l"
    tblRemoveDiacriticsCodes(264) = &H23D:         tblRemoveDiacriticsChars(264) = "L"
    tblRemoveDiacriticsCodes(265) = &H1E36:        tblRemoveDiacriticsChars(265) = "L"
    tblRemoveDiacriticsCodes(266) = &H1E38:        tblRemoveDiacriticsChars(266) = "L"
    tblRemoveDiacriticsCodes(267) = &H1E3A:        tblRemoveDiacriticsChars(267) = "L"
    tblRemoveDiacriticsCodes(268) = &H1E3C:        tblRemoveDiacriticsChars(268) = "L"
    tblRemoveDiacriticsCodes(269) = &H1E3F:        tblRemoveDiacriticsChars(269) = "m"
    tblRemoveDiacriticsCodes(270) = &H1E41:        tblRemoveDiacriticsChars(270) = "m"
    tblRemoveDiacriticsCodes(271) = &H1E43:        tblRemoveDiacriticsChars(271) = "m"
    tblRemoveDiacriticsCodes(272) = &H1E3E:        tblRemoveDiacriticsChars(272) = "M"
    tblRemoveDiacriticsCodes(273) = &H1E40:        tblRemoveDiacriticsChars(273) = "M"
    tblRemoveDiacriticsCodes(274) = &H1E42:        tblRemoveDiacriticsChars(274) = "M"
    tblRemoveDiacriticsCodes(275) = &HF1:          tblRemoveDiacriticsChars(275) = "n"
    tblRemoveDiacriticsCodes(276) = &H144:         tblRemoveDiacriticsChars(276) = "n"
    tblRemoveDiacriticsCodes(277) = &H146:         tblRemoveDiacriticsChars(277) = "n"
    tblRemoveDiacriticsCodes(278) = &H148:         tblRemoveDiacriticsChars(278) = "n"
    tblRemoveDiacriticsCodes(279) = &H149:         tblRemoveDiacriticsChars(279) = "n"
    tblRemoveDiacriticsCodes(280) = &H19E:         tblRemoveDiacriticsChars(280) = "n"
    tblRemoveDiacriticsCodes(281) = &H1F9:         tblRemoveDiacriticsChars(281) = "n"
    tblRemoveDiacriticsCodes(282) = &H235:         tblRemoveDiacriticsChars(282) = "n"
    tblRemoveDiacriticsCodes(283) = &H1E45:        tblRemoveDiacriticsChars(283) = "n"
    tblRemoveDiacriticsCodes(284) = &H1E47:        tblRemoveDiacriticsChars(284) = "n"
    tblRemoveDiacriticsCodes(285) = &H1E49:        tblRemoveDiacriticsChars(285) = "n"
    tblRemoveDiacriticsCodes(286) = &H1E4B:        tblRemoveDiacriticsChars(286) = "n"
    tblRemoveDiacriticsCodes(287) = &HD1:          tblRemoveDiacriticsChars(287) = "N"
    tblRemoveDiacriticsCodes(288) = &H143:         tblRemoveDiacriticsChars(288) = "N"
    tblRemoveDiacriticsCodes(289) = &H145:         tblRemoveDiacriticsChars(289) = "N"
    tblRemoveDiacriticsCodes(290) = &H147:         tblRemoveDiacriticsChars(290) = "N"
    tblRemoveDiacriticsCodes(291) = &H19D:         tblRemoveDiacriticsChars(291) = "N"
    tblRemoveDiacriticsCodes(292) = &H1F8:         tblRemoveDiacriticsChars(292) = "N"
    tblRemoveDiacriticsCodes(293) = &H220:         tblRemoveDiacriticsChars(293) = "N"
    tblRemoveDiacriticsCodes(294) = &H1E44:        tblRemoveDiacriticsChars(294) = "N"
    tblRemoveDiacriticsCodes(295) = &H1E46:        tblRemoveDiacriticsChars(295) = "N"
    tblRemoveDiacriticsCodes(296) = &H1E48:        tblRemoveDiacriticsChars(296) = "N"
    tblRemoveDiacriticsCodes(297) = &H1E4A:        tblRemoveDiacriticsChars(297) = "N"
    tblRemoveDiacriticsCodes(298) = &HF2:          tblRemoveDiacriticsChars(298) = "o"
    tblRemoveDiacriticsCodes(299) = &HF3:          tblRemoveDiacriticsChars(299) = "o"
    tblRemoveDiacriticsCodes(300) = &HF4:          tblRemoveDiacriticsChars(300) = "o"
    tblRemoveDiacriticsCodes(301) = &HF5:          tblRemoveDiacriticsChars(301) = "o"
    tblRemoveDiacriticsCodes(302) = &HF6:          tblRemoveDiacriticsChars(302) = "o"
    tblRemoveDiacriticsCodes(303) = &HF8:          tblRemoveDiacriticsChars(303) = "o"
    tblRemoveDiacriticsCodes(304) = &H14D:         tblRemoveDiacriticsChars(304) = "o"
    tblRemoveDiacriticsCodes(305) = &H14F:         tblRemoveDiacriticsChars(305) = "o"
    tblRemoveDiacriticsCodes(306) = &H151:         tblRemoveDiacriticsChars(306) = "o"
    tblRemoveDiacriticsCodes(307) = &H1A1:         tblRemoveDiacriticsChars(307) = "o"
    tblRemoveDiacriticsCodes(308) = &H1D2:         tblRemoveDiacriticsChars(308) = "o"
    tblRemoveDiacriticsCodes(309) = &H1EB:         tblRemoveDiacriticsChars(309) = "o"
    tblRemoveDiacriticsCodes(310) = &H1ED:         tblRemoveDiacriticsChars(310) = "o"
    tblRemoveDiacriticsCodes(311) = &H1FF:         tblRemoveDiacriticsChars(311) = "o"
    tblRemoveDiacriticsCodes(312) = &H20D:         tblRemoveDiacriticsChars(312) = "o"
    tblRemoveDiacriticsCodes(313) = &H20F:         tblRemoveDiacriticsChars(313) = "o"
    tblRemoveDiacriticsCodes(314) = &H22B:         tblRemoveDiacriticsChars(314) = "o"
    tblRemoveDiacriticsCodes(315) = &H22D:         tblRemoveDiacriticsChars(315) = "o"
    tblRemoveDiacriticsCodes(316) = &H22F:         tblRemoveDiacriticsChars(316) = "o"
    tblRemoveDiacriticsCodes(317) = &H231:         tblRemoveDiacriticsChars(317) = "o"
    tblRemoveDiacriticsCodes(318) = &H1E4D:        tblRemoveDiacriticsChars(318) = "o"
    tblRemoveDiacriticsCodes(319) = &H1E4F:        tblRemoveDiacriticsChars(319) = "o"
    tblRemoveDiacriticsCodes(320) = &H1E51:        tblRemoveDiacriticsChars(320) = "o"
    tblRemoveDiacriticsCodes(321) = &H1E53:        tblRemoveDiacriticsChars(321) = "o"
    tblRemoveDiacriticsCodes(322) = &H1ECD:        tblRemoveDiacriticsChars(322) = "o"
    tblRemoveDiacriticsCodes(323) = &H1ECF:        tblRemoveDiacriticsChars(323) = "o"
    tblRemoveDiacriticsCodes(324) = &H1ED1:        tblRemoveDiacriticsChars(324) = "o"
    tblRemoveDiacriticsCodes(325) = &H1ED3:        tblRemoveDiacriticsChars(325) = "o"
    tblRemoveDiacriticsCodes(326) = &H1ED5:        tblRemoveDiacriticsChars(326) = "o"
    tblRemoveDiacriticsCodes(327) = &H1ED7:        tblRemoveDiacriticsChars(327) = "o"
    tblRemoveDiacriticsCodes(328) = &H1ED9:        tblRemoveDiacriticsChars(328) = "o"
    tblRemoveDiacriticsCodes(329) = &H1EDB:        tblRemoveDiacriticsChars(329) = "o"
    tblRemoveDiacriticsCodes(330) = &H1EDD:        tblRemoveDiacriticsChars(330) = "o"
    tblRemoveDiacriticsCodes(331) = &H1EDF:        tblRemoveDiacriticsChars(331) = "o"
    tblRemoveDiacriticsCodes(332) = &H1EE1:        tblRemoveDiacriticsChars(332) = "o"
    tblRemoveDiacriticsCodes(333) = &H1EE3:        tblRemoveDiacriticsChars(333) = "o"
    tblRemoveDiacriticsCodes(334) = &HD2:          tblRemoveDiacriticsChars(334) = "O"
    tblRemoveDiacriticsCodes(335) = &HD3:          tblRemoveDiacriticsChars(335) = "O"
    tblRemoveDiacriticsCodes(336) = &HD4:          tblRemoveDiacriticsChars(336) = "O"
    tblRemoveDiacriticsCodes(337) = &HD5:          tblRemoveDiacriticsChars(337) = "O"
    tblRemoveDiacriticsCodes(338) = &HD6:          tblRemoveDiacriticsChars(338) = "O"
    tblRemoveDiacriticsCodes(339) = &HD8:          tblRemoveDiacriticsChars(339) = "O"
    tblRemoveDiacriticsCodes(340) = &H14C:         tblRemoveDiacriticsChars(340) = "O"
    tblRemoveDiacriticsCodes(341) = &H14E:         tblRemoveDiacriticsChars(341) = "O"
    tblRemoveDiacriticsCodes(342) = &H150:         tblRemoveDiacriticsChars(342) = "O"
    tblRemoveDiacriticsCodes(343) = &H19F:         tblRemoveDiacriticsChars(343) = "O"
    tblRemoveDiacriticsCodes(344) = &H1A0:         tblRemoveDiacriticsChars(344) = "O"
    tblRemoveDiacriticsCodes(345) = &H1D1:         tblRemoveDiacriticsChars(345) = "O"
    tblRemoveDiacriticsCodes(346) = &H1EA:         tblRemoveDiacriticsChars(346) = "O"
    tblRemoveDiacriticsCodes(347) = &H1EC:         tblRemoveDiacriticsChars(347) = "O"
    tblRemoveDiacriticsCodes(348) = &H1FE:         tblRemoveDiacriticsChars(348) = "O"
    tblRemoveDiacriticsCodes(349) = &H20C:         tblRemoveDiacriticsChars(349) = "O"
    tblRemoveDiacriticsCodes(350) = &H20E:         tblRemoveDiacriticsChars(350) = "O"
    tblRemoveDiacriticsCodes(351) = &H22A:         tblRemoveDiacriticsChars(351) = "O"
    tblRemoveDiacriticsCodes(352) = &H22C:         tblRemoveDiacriticsChars(352) = "O"
    tblRemoveDiacriticsCodes(353) = &H22E:         tblRemoveDiacriticsChars(353) = "O"
    tblRemoveDiacriticsCodes(354) = &H230:         tblRemoveDiacriticsChars(354) = "O"
    tblRemoveDiacriticsCodes(355) = &H1E4C:        tblRemoveDiacriticsChars(355) = "O"
    tblRemoveDiacriticsCodes(356) = &H1E4E:        tblRemoveDiacriticsChars(356) = "O"
    tblRemoveDiacriticsCodes(357) = &H1E50:        tblRemoveDiacriticsChars(357) = "O"
    tblRemoveDiacriticsCodes(358) = &H1E52:        tblRemoveDiacriticsChars(358) = "O"
    tblRemoveDiacriticsCodes(359) = &H1ECC:        tblRemoveDiacriticsChars(359) = "O"
    tblRemoveDiacriticsCodes(360) = &H1ECE:        tblRemoveDiacriticsChars(360) = "O"
    tblRemoveDiacriticsCodes(361) = &H1ED0:        tblRemoveDiacriticsChars(361) = "O"
    tblRemoveDiacriticsCodes(362) = &H1ED2:        tblRemoveDiacriticsChars(362) = "O"
    tblRemoveDiacriticsCodes(363) = &H1ED4:        tblRemoveDiacriticsChars(363) = "O"
    tblRemoveDiacriticsCodes(364) = &H1ED6:        tblRemoveDiacriticsChars(364) = "O"
    tblRemoveDiacriticsCodes(365) = &H1ED8:        tblRemoveDiacriticsChars(365) = "O"
    tblRemoveDiacriticsCodes(366) = &H1EDA:        tblRemoveDiacriticsChars(366) = "O"
    tblRemoveDiacriticsCodes(367) = &H1EDC:        tblRemoveDiacriticsChars(367) = "O"
    tblRemoveDiacriticsCodes(368) = &H1EDE:        tblRemoveDiacriticsChars(368) = "O"
    tblRemoveDiacriticsCodes(369) = &H1EE0:        tblRemoveDiacriticsChars(369) = "O"
    tblRemoveDiacriticsCodes(370) = &H1EE2:        tblRemoveDiacriticsChars(370) = "O"
    tblRemoveDiacriticsCodes(371) = &H1A5:         tblRemoveDiacriticsChars(371) = "p"
    tblRemoveDiacriticsCodes(372) = &H1E55:        tblRemoveDiacriticsChars(372) = "p"
    tblRemoveDiacriticsCodes(373) = &H1E57:        tblRemoveDiacriticsChars(373) = "p"
    tblRemoveDiacriticsCodes(374) = &H1A4:         tblRemoveDiacriticsChars(374) = "P"
    tblRemoveDiacriticsCodes(375) = &H1E54:        tblRemoveDiacriticsChars(375) = "P"
    tblRemoveDiacriticsCodes(376) = &H1E56:        tblRemoveDiacriticsChars(376) = "P"
    tblRemoveDiacriticsCodes(377) = &H24B:         tblRemoveDiacriticsChars(377) = "q"
    tblRemoveDiacriticsCodes(378) = &H24A:         tblRemoveDiacriticsChars(378) = "Q"
    tblRemoveDiacriticsCodes(379) = &H155:         tblRemoveDiacriticsChars(379) = "r"
    tblRemoveDiacriticsCodes(380) = &H157:         tblRemoveDiacriticsChars(380) = "r"
    tblRemoveDiacriticsCodes(381) = &H159:         tblRemoveDiacriticsChars(381) = "r"
    tblRemoveDiacriticsCodes(382) = &H211:         tblRemoveDiacriticsChars(382) = "r"
    tblRemoveDiacriticsCodes(383) = &H213:         tblRemoveDiacriticsChars(383) = "r"
    tblRemoveDiacriticsCodes(384) = &H24D:         tblRemoveDiacriticsChars(384) = "r"
    tblRemoveDiacriticsCodes(385) = &H1E59:        tblRemoveDiacriticsChars(385) = "r"
    tblRemoveDiacriticsCodes(386) = &H1E5B:        tblRemoveDiacriticsChars(386) = "r"
    tblRemoveDiacriticsCodes(387) = &H1E5D:        tblRemoveDiacriticsChars(387) = "r"
    tblRemoveDiacriticsCodes(388) = &H1E5F:        tblRemoveDiacriticsChars(388) = "r"
    tblRemoveDiacriticsCodes(389) = &H154:         tblRemoveDiacriticsChars(389) = "R"
    tblRemoveDiacriticsCodes(390) = &H156:         tblRemoveDiacriticsChars(390) = "R"
    tblRemoveDiacriticsCodes(391) = &H158:         tblRemoveDiacriticsChars(391) = "R"
    tblRemoveDiacriticsCodes(392) = &H210:         tblRemoveDiacriticsChars(392) = "R"
    tblRemoveDiacriticsCodes(393) = &H212:         tblRemoveDiacriticsChars(393) = "R"
    tblRemoveDiacriticsCodes(394) = &H24C:         tblRemoveDiacriticsChars(394) = "R"
    tblRemoveDiacriticsCodes(395) = &H1E58:        tblRemoveDiacriticsChars(395) = "R"
    tblRemoveDiacriticsCodes(396) = &H1E5A:        tblRemoveDiacriticsChars(396) = "R"
    tblRemoveDiacriticsCodes(397) = &H1E5C:        tblRemoveDiacriticsChars(397) = "R"
    tblRemoveDiacriticsCodes(398) = &H1E5E:        tblRemoveDiacriticsChars(398) = "R"
    tblRemoveDiacriticsCodes(399) = &H15B:         tblRemoveDiacriticsChars(399) = "s"
    tblRemoveDiacriticsCodes(400) = &H15D:         tblRemoveDiacriticsChars(400) = "s"
    tblRemoveDiacriticsCodes(401) = &H15F:         tblRemoveDiacriticsChars(401) = "s"
    tblRemoveDiacriticsCodes(402) = &H161:         tblRemoveDiacriticsChars(402) = "s"
    tblRemoveDiacriticsCodes(403) = &H219:         tblRemoveDiacriticsChars(403) = "s"
    tblRemoveDiacriticsCodes(404) = &H23F:         tblRemoveDiacriticsChars(404) = "s"
    tblRemoveDiacriticsCodes(405) = &H1E61:        tblRemoveDiacriticsChars(405) = "s"
    tblRemoveDiacriticsCodes(406) = &H1E63:        tblRemoveDiacriticsChars(406) = "s"
    tblRemoveDiacriticsCodes(407) = &H1E65:        tblRemoveDiacriticsChars(407) = "s"
    tblRemoveDiacriticsCodes(408) = &H1E67:        tblRemoveDiacriticsChars(408) = "s"
    tblRemoveDiacriticsCodes(409) = &H1E69:        tblRemoveDiacriticsChars(409) = "s"
    tblRemoveDiacriticsCodes(410) = &H15A:         tblRemoveDiacriticsChars(410) = "S"
    tblRemoveDiacriticsCodes(411) = &H15C:         tblRemoveDiacriticsChars(411) = "S"
    tblRemoveDiacriticsCodes(412) = &H15E:         tblRemoveDiacriticsChars(412) = "S"
    tblRemoveDiacriticsCodes(413) = &H160:         tblRemoveDiacriticsChars(413) = "S"
    tblRemoveDiacriticsCodes(414) = &H218:         tblRemoveDiacriticsChars(414) = "S"
    tblRemoveDiacriticsCodes(415) = &H1E60:        tblRemoveDiacriticsChars(415) = "S"
    tblRemoveDiacriticsCodes(416) = &H1E62:        tblRemoveDiacriticsChars(416) = "S"
    tblRemoveDiacriticsCodes(417) = &H1E64:        tblRemoveDiacriticsChars(417) = "S"
    tblRemoveDiacriticsCodes(418) = &H1E66:        tblRemoveDiacriticsChars(418) = "S"
    tblRemoveDiacriticsCodes(419) = &H1E68:        tblRemoveDiacriticsChars(419) = "S"
    tblRemoveDiacriticsCodes(420) = &H163:         tblRemoveDiacriticsChars(420) = "t"
    tblRemoveDiacriticsCodes(421) = &H165:         tblRemoveDiacriticsChars(421) = "t"
    tblRemoveDiacriticsCodes(422) = &H167:         tblRemoveDiacriticsChars(422) = "t"
    tblRemoveDiacriticsCodes(423) = &H1AB:         tblRemoveDiacriticsChars(423) = "t"
    tblRemoveDiacriticsCodes(424) = &H1AD:         tblRemoveDiacriticsChars(424) = "t"
    tblRemoveDiacriticsCodes(425) = &H21B:         tblRemoveDiacriticsChars(425) = "t"
    tblRemoveDiacriticsCodes(426) = &H236:         tblRemoveDiacriticsChars(426) = "t"
    tblRemoveDiacriticsCodes(427) = &H1E6B:        tblRemoveDiacriticsChars(427) = "t"
    tblRemoveDiacriticsCodes(428) = &H1E6D:        tblRemoveDiacriticsChars(428) = "t"
    tblRemoveDiacriticsCodes(429) = &H1E6F:        tblRemoveDiacriticsChars(429) = "t"
    tblRemoveDiacriticsCodes(430) = &H1E71:        tblRemoveDiacriticsChars(430) = "t"
    tblRemoveDiacriticsCodes(431) = &H1E97:        tblRemoveDiacriticsChars(431) = "t"
    tblRemoveDiacriticsCodes(432) = &H162:         tblRemoveDiacriticsChars(432) = "T"
    tblRemoveDiacriticsCodes(433) = &H164:         tblRemoveDiacriticsChars(433) = "T"
    tblRemoveDiacriticsCodes(434) = &H166:         tblRemoveDiacriticsChars(434) = "T"
    tblRemoveDiacriticsCodes(435) = &H1AC:         tblRemoveDiacriticsChars(435) = "T"
    tblRemoveDiacriticsCodes(436) = &H1AE:         tblRemoveDiacriticsChars(436) = "T"
    tblRemoveDiacriticsCodes(437) = &H21A:         tblRemoveDiacriticsChars(437) = "T"
    tblRemoveDiacriticsCodes(438) = &H23E:         tblRemoveDiacriticsChars(438) = "T"
    tblRemoveDiacriticsCodes(439) = &H1E6A:        tblRemoveDiacriticsChars(439) = "T"
    tblRemoveDiacriticsCodes(440) = &H1E6C:        tblRemoveDiacriticsChars(440) = "T"
    tblRemoveDiacriticsCodes(441) = &H1E6E:        tblRemoveDiacriticsChars(441) = "T"
    tblRemoveDiacriticsCodes(442) = &H1E70:        tblRemoveDiacriticsChars(442) = "T"
    tblRemoveDiacriticsCodes(443) = &HF9:          tblRemoveDiacriticsChars(443) = "u"
    tblRemoveDiacriticsCodes(444) = &HFA:          tblRemoveDiacriticsChars(444) = "u"
    tblRemoveDiacriticsCodes(445) = &HFB:          tblRemoveDiacriticsChars(445) = "u"
    tblRemoveDiacriticsCodes(446) = &HFC:          tblRemoveDiacriticsChars(446) = "u"
    tblRemoveDiacriticsCodes(447) = &H169:         tblRemoveDiacriticsChars(447) = "u"
    tblRemoveDiacriticsCodes(448) = &H16B:         tblRemoveDiacriticsChars(448) = "u"
    tblRemoveDiacriticsCodes(449) = &H16D:         tblRemoveDiacriticsChars(449) = "u"
    tblRemoveDiacriticsCodes(450) = &H16F:         tblRemoveDiacriticsChars(450) = "u"
    tblRemoveDiacriticsCodes(451) = &H171:         tblRemoveDiacriticsChars(451) = "u"
    tblRemoveDiacriticsCodes(452) = &H173:         tblRemoveDiacriticsChars(452) = "u"
    tblRemoveDiacriticsCodes(453) = &H1B0:         tblRemoveDiacriticsChars(453) = "u"
    tblRemoveDiacriticsCodes(454) = &H1D4:         tblRemoveDiacriticsChars(454) = "u"
    tblRemoveDiacriticsCodes(455) = &H1D6:         tblRemoveDiacriticsChars(455) = "u"
    tblRemoveDiacriticsCodes(456) = &H1D8:         tblRemoveDiacriticsChars(456) = "u"
    tblRemoveDiacriticsCodes(457) = &H1DA:         tblRemoveDiacriticsChars(457) = "u"
    tblRemoveDiacriticsCodes(458) = &H1DC:         tblRemoveDiacriticsChars(458) = "u"
    tblRemoveDiacriticsCodes(459) = &H215:         tblRemoveDiacriticsChars(459) = "u"
    tblRemoveDiacriticsCodes(460) = &H217:         tblRemoveDiacriticsChars(460) = "u"
    tblRemoveDiacriticsCodes(461) = &H1E73:        tblRemoveDiacriticsChars(461) = "u"
    tblRemoveDiacriticsCodes(462) = &H1E75:        tblRemoveDiacriticsChars(462) = "u"
    tblRemoveDiacriticsCodes(463) = &H1E77:        tblRemoveDiacriticsChars(463) = "u"
    tblRemoveDiacriticsCodes(464) = &H1E79:        tblRemoveDiacriticsChars(464) = "u"
    tblRemoveDiacriticsCodes(465) = &H1E7B:        tblRemoveDiacriticsChars(465) = "u"
    tblRemoveDiacriticsCodes(466) = &H1EE5:        tblRemoveDiacriticsChars(466) = "u"
    tblRemoveDiacriticsCodes(467) = &H1EE7:        tblRemoveDiacriticsChars(467) = "u"
    tblRemoveDiacriticsCodes(468) = &H1EE9:        tblRemoveDiacriticsChars(468) = "u"
    tblRemoveDiacriticsCodes(469) = &H1EEB:        tblRemoveDiacriticsChars(469) = "u"
    tblRemoveDiacriticsCodes(470) = &H1EED:        tblRemoveDiacriticsChars(470) = "u"
    tblRemoveDiacriticsCodes(471) = &H1EEF:        tblRemoveDiacriticsChars(471) = "u"
    tblRemoveDiacriticsCodes(472) = &H1EF1:        tblRemoveDiacriticsChars(472) = "u"
    tblRemoveDiacriticsCodes(473) = &HD9:          tblRemoveDiacriticsChars(473) = "U"
    tblRemoveDiacriticsCodes(474) = &HDA:          tblRemoveDiacriticsChars(474) = "U"
    tblRemoveDiacriticsCodes(475) = &HDB:          tblRemoveDiacriticsChars(475) = "U"
    tblRemoveDiacriticsCodes(476) = &HDC:          tblRemoveDiacriticsChars(476) = "U"
    tblRemoveDiacriticsCodes(477) = &H168:         tblRemoveDiacriticsChars(477) = "U"
    tblRemoveDiacriticsCodes(478) = &H16A:         tblRemoveDiacriticsChars(478) = "U"
    tblRemoveDiacriticsCodes(479) = &H16C:         tblRemoveDiacriticsChars(479) = "U"
    tblRemoveDiacriticsCodes(480) = &H16E:         tblRemoveDiacriticsChars(480) = "U"
    tblRemoveDiacriticsCodes(481) = &H170:         tblRemoveDiacriticsChars(481) = "U"
    tblRemoveDiacriticsCodes(482) = &H172:         tblRemoveDiacriticsChars(482) = "U"
    tblRemoveDiacriticsCodes(483) = &H1AF:         tblRemoveDiacriticsChars(483) = "U"
    tblRemoveDiacriticsCodes(484) = &H1D3:         tblRemoveDiacriticsChars(484) = "U"
    tblRemoveDiacriticsCodes(485) = &H1D5:         tblRemoveDiacriticsChars(485) = "U"
    tblRemoveDiacriticsCodes(486) = &H1D7:         tblRemoveDiacriticsChars(486) = "U"
    tblRemoveDiacriticsCodes(487) = &H1D9:         tblRemoveDiacriticsChars(487) = "U"
    tblRemoveDiacriticsCodes(488) = &H1DB:         tblRemoveDiacriticsChars(488) = "U"
    tblRemoveDiacriticsCodes(489) = &H214:         tblRemoveDiacriticsChars(489) = "U"
    tblRemoveDiacriticsCodes(490) = &H216:         tblRemoveDiacriticsChars(490) = "U"
    tblRemoveDiacriticsCodes(491) = &H244:         tblRemoveDiacriticsChars(491) = "U"
    tblRemoveDiacriticsCodes(492) = &H1E72:        tblRemoveDiacriticsChars(492) = "U"
    tblRemoveDiacriticsCodes(493) = &H1E74:        tblRemoveDiacriticsChars(493) = "U"
    tblRemoveDiacriticsCodes(494) = &H1E76:        tblRemoveDiacriticsChars(494) = "U"
    tblRemoveDiacriticsCodes(495) = &H1E78:        tblRemoveDiacriticsChars(495) = "U"
    tblRemoveDiacriticsCodes(496) = &H1E7A:        tblRemoveDiacriticsChars(496) = "U"
    tblRemoveDiacriticsCodes(497) = &H1EE4:        tblRemoveDiacriticsChars(497) = "U"
    tblRemoveDiacriticsCodes(498) = &H1EE6:        tblRemoveDiacriticsChars(498) = "U"
    tblRemoveDiacriticsCodes(499) = &H1EE8:        tblRemoveDiacriticsChars(499) = "U"
    tblRemoveDiacriticsCodes(500) = &H1EEA:        tblRemoveDiacriticsChars(500) = "U"
    tblRemoveDiacriticsCodes(501) = &H1EEC:        tblRemoveDiacriticsChars(501) = "U"
    tblRemoveDiacriticsCodes(502) = &H1EEE:        tblRemoveDiacriticsChars(502) = "U"
    tblRemoveDiacriticsCodes(503) = &H1EF0:        tblRemoveDiacriticsChars(503) = "U"
    tblRemoveDiacriticsCodes(504) = &H1E7D:        tblRemoveDiacriticsChars(504) = "v"
    tblRemoveDiacriticsCodes(505) = &H1E7F:        tblRemoveDiacriticsChars(505) = "v"
    tblRemoveDiacriticsCodes(506) = &H1B2:         tblRemoveDiacriticsChars(506) = "V"
    tblRemoveDiacriticsCodes(507) = &H1E7C:        tblRemoveDiacriticsChars(507) = "V"
    tblRemoveDiacriticsCodes(508) = &H1E7E:        tblRemoveDiacriticsChars(508) = "V"
    tblRemoveDiacriticsCodes(509) = &H175:         tblRemoveDiacriticsChars(509) = "w"
    tblRemoveDiacriticsCodes(510) = &H1E81:        tblRemoveDiacriticsChars(510) = "w"
    tblRemoveDiacriticsCodes(511) = &H1E83:        tblRemoveDiacriticsChars(511) = "w"
    tblRemoveDiacriticsCodes(512) = &H1E85:        tblRemoveDiacriticsChars(512) = "w"
    tblRemoveDiacriticsCodes(513) = &H1E87:        tblRemoveDiacriticsChars(513) = "w"
    tblRemoveDiacriticsCodes(514) = &H1E89:        tblRemoveDiacriticsChars(514) = "w"
    tblRemoveDiacriticsCodes(515) = &H1E98:        tblRemoveDiacriticsChars(515) = "w"
    tblRemoveDiacriticsCodes(516) = &H174:         tblRemoveDiacriticsChars(516) = "W"
    tblRemoveDiacriticsCodes(517) = &H1E80:        tblRemoveDiacriticsChars(517) = "W"
    tblRemoveDiacriticsCodes(518) = &H1E82:        tblRemoveDiacriticsChars(518) = "W"
    tblRemoveDiacriticsCodes(519) = &H1E84:        tblRemoveDiacriticsChars(519) = "W"
    tblRemoveDiacriticsCodes(520) = &H1E86:        tblRemoveDiacriticsChars(520) = "W"
    tblRemoveDiacriticsCodes(521) = &H1E88:        tblRemoveDiacriticsChars(521) = "W"
    tblRemoveDiacriticsCodes(522) = &H1E8B:        tblRemoveDiacriticsChars(522) = "x"
    tblRemoveDiacriticsCodes(523) = &H1E8D:        tblRemoveDiacriticsChars(523) = "x"
    tblRemoveDiacriticsCodes(524) = &H1E8A:        tblRemoveDiacriticsChars(524) = "X"
    tblRemoveDiacriticsCodes(525) = &H1E8C:        tblRemoveDiacriticsChars(525) = "X"
    tblRemoveDiacriticsCodes(526) = &HFD:          tblRemoveDiacriticsChars(526) = "y"
    tblRemoveDiacriticsCodes(527) = &HFF:          tblRemoveDiacriticsChars(527) = "y"
    tblRemoveDiacriticsCodes(528) = &H177:         tblRemoveDiacriticsChars(528) = "y"
    tblRemoveDiacriticsCodes(529) = &H1B4:         tblRemoveDiacriticsChars(529) = "y"
    tblRemoveDiacriticsCodes(530) = &H233:         tblRemoveDiacriticsChars(530) = "y"
    tblRemoveDiacriticsCodes(531) = &H24F:         tblRemoveDiacriticsChars(531) = "y"
    tblRemoveDiacriticsCodes(532) = &H1E8F:        tblRemoveDiacriticsChars(532) = "y"
    tblRemoveDiacriticsCodes(533) = &H1E99:        tblRemoveDiacriticsChars(533) = "y"
    tblRemoveDiacriticsCodes(534) = &H1EF3:        tblRemoveDiacriticsChars(534) = "y"
    tblRemoveDiacriticsCodes(535) = &H1EF5:        tblRemoveDiacriticsChars(535) = "y"
    tblRemoveDiacriticsCodes(536) = &H1EF7:        tblRemoveDiacriticsChars(536) = "y"
    tblRemoveDiacriticsCodes(537) = &H1EF9:        tblRemoveDiacriticsChars(537) = "y"
    tblRemoveDiacriticsCodes(538) = &HDD:          tblRemoveDiacriticsChars(538) = "Y"
    tblRemoveDiacriticsCodes(539) = &H176:         tblRemoveDiacriticsChars(539) = "Y"
    tblRemoveDiacriticsCodes(540) = &H178:         tblRemoveDiacriticsChars(540) = "Y"
    tblRemoveDiacriticsCodes(541) = &H1B3:         tblRemoveDiacriticsChars(541) = "Y"
    tblRemoveDiacriticsCodes(542) = &H232:         tblRemoveDiacriticsChars(542) = "Y"
    tblRemoveDiacriticsCodes(543) = &H24E:         tblRemoveDiacriticsChars(543) = "Y"
    tblRemoveDiacriticsCodes(544) = &H1E8E:        tblRemoveDiacriticsChars(544) = "Y"
    tblRemoveDiacriticsCodes(545) = &H1EF2:        tblRemoveDiacriticsChars(545) = "Y"
    tblRemoveDiacriticsCodes(546) = &H1EF4:        tblRemoveDiacriticsChars(546) = "Y"
    tblRemoveDiacriticsCodes(547) = &H1EF6:        tblRemoveDiacriticsChars(547) = "Y"
    tblRemoveDiacriticsCodes(548) = &H1EF8:        tblRemoveDiacriticsChars(548) = "Y"
    tblRemoveDiacriticsCodes(549) = &H17A:         tblRemoveDiacriticsChars(549) = "z"
    tblRemoveDiacriticsCodes(550) = &H17C:         tblRemoveDiacriticsChars(550) = "z"
    tblRemoveDiacriticsCodes(551) = &H17E:         tblRemoveDiacriticsChars(551) = "z"
    tblRemoveDiacriticsCodes(552) = &H1B6:         tblRemoveDiacriticsChars(552) = "z"
    tblRemoveDiacriticsCodes(553) = &H225:         tblRemoveDiacriticsChars(553) = "z"
    tblRemoveDiacriticsCodes(554) = &H240:         tblRemoveDiacriticsChars(554) = "z"
    tblRemoveDiacriticsCodes(555) = &H1E91:        tblRemoveDiacriticsChars(555) = "z"
    tblRemoveDiacriticsCodes(556) = &H1E93:        tblRemoveDiacriticsChars(556) = "z"
    tblRemoveDiacriticsCodes(557) = &H1E95:        tblRemoveDiacriticsChars(557) = "z"
    tblRemoveDiacriticsCodes(558) = &H179:         tblRemoveDiacriticsChars(558) = "Z"
    tblRemoveDiacriticsCodes(559) = &H17B:         tblRemoveDiacriticsChars(559) = "Z"
    tblRemoveDiacriticsCodes(560) = &H17D:         tblRemoveDiacriticsChars(560) = "Z"
    tblRemoveDiacriticsCodes(561) = &H1B5:         tblRemoveDiacriticsChars(561) = "Z"
    tblRemoveDiacriticsCodes(562) = &H224:         tblRemoveDiacriticsChars(562) = "Z"
    tblRemoveDiacriticsCodes(563) = &H1E90:        tblRemoveDiacriticsChars(563) = "Z"
    tblRemoveDiacriticsCodes(564) = &H1E92:        tblRemoveDiacriticsChars(564) = "Z"
    tblRemoveDiacriticsCodes(565) = &H1E94:        tblRemoveDiacriticsChars(565) = "Z"
    
    'Additional characters added
    tblRemoveDiacriticsCodes(566) = &HD0:       tblRemoveDiacriticsChars(566) = "D"
    tblRemoveDiacriticsCodes(567) = &HF0:       tblRemoveDiacriticsChars(567) = "d"
End Sub
 

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
Thank you for your feedback
Unfortunately the code is presenting an error as per below:
Run-time error '58' (File Already exists)

1621088472123.png


File.Name = RemoveDiacritics(File.Name)

1621088502656.png
 

Dan_W

Well-known Member
Joined
Jul 11, 2018
Messages
584
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Ok, well all that's saying is that there already exists a file in the same folder with an identical filename (diacritics removed). Given that you cannot have two files in the same folder with identical names, Excel is returning this error message. Perhaps the easiest way of dealing with this is to just skip the removal of the diacritics, and proceed to the next step. Please replace that line with the following two lines of code and let me know how it goes:

VBA Code:
tmpFilename = RemoveDiacritics(File.Name)
If Len(Dir(File.ParentFolder.Path & Application.PathSeparator & tmpFilename)) > 0 Then File.Name = tmpFilename
 

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
I tested with 2 singles files in a folder as per following file names:
01 - File With Diacritics characters- ŠŽšžŸÀÁ.txt
02 - Without Diacritics characters- SZszYAA.txt

1621212576575.png


The same error pops up

1621212773849.png


When checking the folder, one file has its name changed including the date, and the other file the only change was the blank spaces replaced by "-".
What I mean is that the name of the files are different so we would not supposed to expect that error type.
 

Dan_W

Well-known Member
Joined
Jul 11, 2018
Messages
584
Office Version
  1. 365
Platform
  1. Windows
Sorry - I'm confused - are those the only two files in the folder (for testing purposes)? And the filenames are ŠŽšžŸÀÁ.txt and SZszYAA.txt? What kind of tests are you running (i.e., how many files in the folder, etc)?

1621366201017.png

So I gather that if you step through the code (F8 function key), it will work its way through the entire RemoveDiacritics function and then raise the error at the end? It's a bit tricky to diagnose when I don't have a dataset in front of me. Could you possibly prepare a test folder of say, 20 files - run the code over that folder. If it doesn't work, let me know what the original filenames are so that I can test it myself? Obviously, you would need to choose filenames that don't have personal data / names etc in the filename. I just want to see what's happening for myself.
 
Last edited:

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
Sorry - I'm confused - are those the only two files in the folder (for testing purposes)? And the filenames are ŠŽšžŸÀÁ.txt and SZszYAA.txt? What kind of tests are you running (i.e., how many files in the folder, etc)?

View attachment 38954
So I gather that if you step through the code (F8 function key), it will work its way through the entire RemoveDiacritics function and then raise the error at the end? It's a bit tricky to diagnose when I don't have a dataset in front of me. Could you possibly prepare a test folder of say, 20 files - run the code over that folder. If it doesn't work, let me know what the original filenames are so that I can test it myself? Obviously, you would need to choose filenames that don't have personal data / names etc in the filename. I just want to see what's happening for myself.

Firstly I tried to run the code with many files inside a folder and I had that error. After your advice, that the error could be due duplicated names, I prepared a folder with just 2 files inside and with different names, the same error occurred. I guess that doen't matter if I put 2 or 20 different files, I will get stuck on that particular error.
Given that you cannot have two files in the same folder with identical names, Excel is returning this error message.

By the way, I'm running the code step by step by pressing F8.
 

Forum statistics

Threads
1,141,204
Messages
5,704,954
Members
421,372
Latest member
Jamie11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top