MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / Encoding_MatchA

Function Encoding_MatchA

src/Edit.c:675–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673
674
675int Encoding_MatchA ( char *pchTest )
676{
677 int i;
678 char chTest[256];
679 char *pchSrc = pchTest;
680 char *pchDst = chTest;
681 *pchDst++ = ',';
682 while ( *pchSrc ) {
683 if ( IsCharAlphaNumericA ( *pchSrc ) ) {
684 *pchDst++ = *CharLowerA ( pchSrc );
685 }
686 pchSrc++;
687 }
688 *pchDst++ = ',';
689 *pchDst = 0;
690 for ( i = 0; i < COUNTOF ( mEncoding ); i++ ) {
691 if ( StrStrIA ( mEncoding[i].pszParseNames, chTest ) ) {
692 CPINFO cpi;
693 if ( ( mEncoding[i].uFlags & NCP_INTERNAL ) ||
694 IsValidCodePage ( mEncoding[i].uCodePage ) &&
695 GetCPInfo ( mEncoding[i].uCodePage, &cpi ) ) {
696 return ( i );
697 } else {
698 return ( -1 );
699 }
700 }
701 }
702 return ( -1 );
703}
704
705
706BOOL Encoding_IsValid ( int iTestEncoding )

Callers 2

Encoding_MatchWFunction · 0.85
FileVars_InitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected