Old 26th August 2021, 18:14   #1
Symbicort
Junior Member
 
Join Date: Aug 2021
Posts: 5
Prevent double byte characters

Is there a way to prevent double byte characters being used user inputted text fields ? I only want charcaters in the range of (! - ~ ) I need to interact with an old ini file that doesn't like double byte characters.

Its a username and password field so I was thinking of using a regex maybe. But just wondering if there is another way of banning them outright
Symbicort is offline   Reply With Quote
Old 27th August 2021, 03:11   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,418
Filtering on the fly is a bit tricky.

A slightly less elegant method is to NSD_GetText in the page leave callback (you are probably doing this anyway?) and check the string. You can take a look at the answer here where I'm checking a string with regex and checking ASCII codes...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
nsis

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump