0

I have a node.js application that uses express sessions.

I use the sessions to display error messages to the users, such as when they type in an invalid username/password.

The website is in German and I can't make the app display accented characters. For example, when users type a wrong password in the login form, this code uses flash to display an error message:

if (result === false) {
        req.session.flash = {
            type: 'danger',
            intro: 'Ooops',
            message: 'Ungültige Email und/oder Passwort. Bitte erneut versuchen.',
        };
        res.redirect(303, '/login');            
    }

The message as noted above is displayed as "Ung�ltige Email und/oder Passwort. Bitte erneut versuchen."

How do I get the flash messages to properly encode the strings when using accented characters?

Luis Delgado
  • 3,644
  • 4
  • 34
  • 54

0 Answers0