1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 16:45:16 +00:00

Fix encoding issue

This commit is contained in:
2019-11-23 19:00:55 +01:00
parent 0cb6688884
commit 17f70b956b
2 changed files with 12 additions and 2 deletions

View File

@ -12,4 +12,13 @@
*/
export function checkMail(emailAddress: string): boolean {
return (emailAddress.match(/^[a-zA-Z0-9_.]+@[a-zA-Z0-9-.]{1,}[.][a-zA-Z]{2,8}$/) === null ? false : true);
}
/**
* Fix text encoding
*
* @param input Input string
*/
export function fixEncoding(input : string) : string {
return Buffer.from(input, "latin1").toString("utf-8");
}