@jchd
#include <Array.au3>
#include <String.au3>
Local $a = [ _
"Greengrocers’ apostrophes", _
"St James’S Park", _
"ladies’ hats", _
"Le Cléac'H", _
"O'Malley", _
"80's music", _
"Ho, mia kor’! Post longa laborado", _
"John's shoes", _
"doesn'T mean anything ƨƳƭƫƼ'Ɖƃ sorry it's my fault", _
"Διεθνής εβδομάδα χειμερ’ινών αγώνων", _
"Тиждень зимо՚вих видів спорту (насправді 11 днів)", _
" ഇതിൽ അഞ്ചു വളയങ്ങൾ'ആലേഖനം ", _
"μζΣΨϑ'ʤʞʫʀ" _
]
Local $hTimer = TimerInit()
For $i = 0 To UBound($a) - 1
$a[$i] = _StringProper_jpm($a[$i])
Next
Local $iDiff = TimerDiff($hTimer)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iDiff = ' & $iDiff & @CRLF & '>Error code: ' & @error & ' Extended code: ' & @extended & ' (0x' & Hex(@extended) & ')' & @CRLF) ;### Debug Console
_ArrayDisplay($a)
Func _StringProper_jchd($s)
Local Static $sPattern = "(*UCP)\b((?<!['՚‘’“”ʼʾ׳״])[[:lower:]])"
Return Execute('"' & StringRegExpReplace(StringLower($s), $sPattern, '" & StringUpper("$1") & "') & '"')
EndFunc ;==>_StringProper_jchd
Func _StringProper_jpm($sString)
Local $bCapNext = True, $sChr = "", $sReturn = ""
Local Static $sPattern = '[a-zA-ZÀ-ÿšœžŸ]'
Local $iStrLen = StringLen($sString)
For $i = 1 To $iStrLen
$sChr = StringMid($sString, $i, 1)
Select
Case $bCapNext = True
If StringRegExp($sChr, $sPattern) Then
If $i <> $iStrLen And StringMid($sString, $i + 1, 1) <> " " Then
$sChr = StringUpper($sChr)
Else
$sChr = StringLower($sChr)
EndIf
$bCapNext = False
EndIf
Case Not StringRegExp($sChr, $sPattern)
$bCapNext = True
Case Else
$sChr = StringLower($sChr)
EndSelect
$sReturn &= $sChr
Next
Return $sReturn
EndFunc ;==>_StringProper_jpm
Unless you have a regexp for O'Malley, What do you think about a slight mod of the current implementation of _StringProper()?