Regex replace accented characters problem

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Pilu
Posts: 84
Joined: 22 Jun 2018, 01:13

Regex replace accented characters problem

02 Mar 2021, 03:09

Hi,

I try replace the accented characters from the string, i use this script.
https://www.autohotkey.com/boards/viewtopic.php?t=61626

Code: Select all

chars :=	{a:"[áàâǎăãảạäåāąấầẫẩậắằẵẳặǻ]"
		,c:"[ćĉčċç]"
		,d:"[ďđð]"
		,e:"[éèêěĕẽẻėëēęếềễểẹệ]"
		,g:"[ğĝġģ]"
		,h:"[ĥħ]"
		,i:"[íìĭîǐïĩįīỉị]"
	 	,j:"[ĵ]"
	 	,k:"[ķ]"
	 	,l:"[ĺľļłŀ]"
	 	,n:"[ńňñņ]"
	 	,o:"[óòŏôốồỗổǒöőõøǿōỏơớờỡởợọộ]"
	 	,p:"[ṕṗ]"
	 	,r:"[ŕřŗ]"
	 	,s:"[śŝšş]"
	 	,t:"[ťţŧ]"
	 	,u:"[úùŭûǔůüǘǜǚǖűũųūủưứừữửựụ]"
	 	,w:"[ẃẁŵẅ]"
	 	,y:"[ýỳŷÿỹỷỵ]"
	 	,z:"[źžż]"}
myString :="The cát jûmped óver thë moon"
For replace, find in chars
	myString :=	RegExReplace(myString,find,replace)
MsgBox %	myString
On my computer when I run the script the sript works well, but when I run the script in my work environment i got this string :
"The caat jaamped aaver thaa moon"

What is the problem?
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Regex replace accented characters problem

02 Mar 2021, 06:49

Is it a different AHK version there? Same when running as admin?
foxhunter
Posts: 72
Joined: 04 Aug 2016, 04:27

Re: Regex replace accented characters problem

02 Mar 2021, 07:02

Use UTF-8-BOM file encoding, not UTF-8 encoding

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, hitman and 177 guests