Skip to content
⌘ NSIS Forum Archive

Prevent double byte characters

2 posts

Symbicort#

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
Anders#
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...