UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Can Utf8 Homgraphs Simplify Special Character Use In Code?    
 
   
Jaiket
post Mar 25 2019, 02:12 AM
Post#1



Posts: 385
Joined: 3-May 17
From: France


Hi,
I was wondering if it would be possible to assign Unicode homographs (they look exactly the same but are interpreted differently) to dissociate special characters according to context.

Example - the apostrophe. In strings it should always be interpreted as a human language indicator - In this sentance it's representing the letter 'i' which is missing, and it is also being used as a single quote around the letter 'i'.
In SQL, the apostrophe is used to mark the start and end of a string -
CODE
DCount("Item", "tblItem", "Item = '" & strSQL & "'") <> 0


I'm way out of my depth, but I thought that maybe if one of the contexts (probably coding) interpreted a typed apostrophe as something other than "U+0027" using a spare unicode point as a homograph it may be possible to resolve the complexities of escaping characters in code.

It could just make things worse if it ends up empowering attackers, but I am ill equipped to see if this is true.
This post has been edited by Jaiket: Mar 25 2019, 02:16 AM

--------------------
Life is too short to drink bad wine.
Go to the top of the page
 
June7
post Mar 25 2019, 02:58 AM
Post#2



Posts: 656
Joined: 25-January 16



If I expect apostrophes in data then I use Replace() function to double the apostrophe in order to escape it.

DCount("Item", "tblItem", "Item = '" & Replace(strSQL, "'", "''") & "'") <> 0

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
GroverParkGeorge
post Mar 25 2019, 08:33 AM
Post#3


UA Admin
Posts: 35,325
Joined: 20-June 02
From: Newcastle, WA


Sometimes it's best to go with the flow. One of my favorite analogies is paddling a canoe on a river. Going upstream is harder and slower. Going downstream is easier and can be faster. Why implement a rather unusual solution when a rather standard one accomplishes the same goal?

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
Jaiket
post Mar 25 2019, 12:04 PM
Post#4



Posts: 385
Joined: 3-May 17
From: France


I thought that if it worked it might be possible for Unicode to do a global fix so coders no longer had to escape special characters. Basically there are 2 distinct entities which are rolled into one, and in the context of code this requires everone to use the standard solution (thanks June). If it was possible to do a global fix, no-one would need a solution because the problem would no longer exist.

But it's a bit beyond me...
Thanks for setting me straight, GPG

--------------------
Life is too short to drink bad wine.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd July 2019 - 06:13 PM