ZXing.PDF417.Internal.PDF417HighLevelEncoder.isDigit(char)

Here are the examples of the csharp api class ZXing.PDF417.Internal.PDF417HighLevelEncoder.isDigit(char) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

9 Examples 7

1. Example

Project: dp2
Source File: PDF417HighLevelEncoder.cs
View license
private static int determineConsecutiveDigitCount(String msg, int startpos)
      {
         int count = 0;
         int len = msg.Length;
         int idx = startpos;
         if (idx < len)
         {
            char ch = msg[idx];
            while (isDigit(ch) && idx < len)
            {
               count++;
               idx++;
               if (idx < len)
               {
                  ch = msg[idx];
               }
            }
         }
         return count;
      }

2. Example

Project: ZXing.Net
Source File: PDF417HighLevelEncoder.cs
View license
private static int determineConsecutiveDigitCount(String msg, int startpos)
      {
         int count = 0;
         int len = msg.Length;
         int idx = startpos;
         if (idx < len)
         {
            char ch = msg[idx];
            while (isDigit(ch) && idx < len)
            {
               count++;
               idx++;
               if (idx < len)
               {
                  ch = msg[idx];
               }
            }
         }
         return count;
      }

3. Example

View license
private static int determineConsecutiveDigitCount(String msg, int startpos)
      {
         int count = 0;
         int len = msg.Length;
         int idx = startpos;
         if (idx < len)
         {
            char ch = msg[idx];
            while (isDigit(ch) && idx < len)
            {
               count++;
               idx++;
               if (idx < len)
               {
                  ch = msg[idx];
               }
            }
         }
         return count;
      }

4. Example

View license
private static int determineConsecutiveBinaryCount(String msg, byte[] bytes, int startpos)
      {
         int len = msg.Length;
         int idx = startpos;
         int idxb = idx;  // bytes index (may differ from idx for utf-8 and other unicode encodings)
         while (idx < len)
         {
            char ch = msg[idx];
            int numericCount = 0;

            while (numericCount < 13 && isDigit(ch))
            {
               numericCount++;
               //textCount++;
               int i = idx + numericCount;
               if (i >= len)
               {
                  break;
               }
               ch = msg[i];
            }
            if (numericCount >= 13)
            {
               return idx - startpos;
            }
            ch = msg[idx];

            //Check if character is encodable
            //Sun returns a ASCII 63 (?) for a character that cannot be mapped. Let's hope all
            //other VMs do the same
            if (bytes[idxb] == 63 && ch != '?')
            {
               throw new WriterException("Non-encodable character detected: " + ch + " (Unicode: " + (int) ch + ')');
            }
            idx++;
            idxb++;
            if (ch >= 256)  // for non-ascii symbols
                idxb++;
         }
         return idx - startpos;
      }

5. Example

Project: dp2
Source File: PDF417HighLevelEncoder.cs
View license
private static int determineConsecutiveTextCount(String msg, int startpos)
      {
         int len = msg.Length;
         int idx = startpos;
         while (idx < len)
         {
            char ch = msg[idx];
            int numericCount = 0;
            while (numericCount < 13 && isDigit(ch) && idx < len)
            {
               numericCount++;
               idx++;
               if (idx < len)
               {
                  ch = msg[idx];
               }
            }
            if (numericCount >= 13)
            {
               return idx - startpos - numericCount;
            }
            if (numericCount > 0)
            {
               //Heuristic: All text-encodable chars or digits are binary encodable
               continue;
            }
            ch = msg[idx];

            //Check if character is encodable
            if (!isText(ch))
            {
               break;
            }
            idx++;
         }
         return idx - startpos;
      }

6. Example

Project: dp2
Source File: PDF417HighLevelEncoder.cs
View license
private static int determineConsecutiveBinaryCount(String msg, byte[] bytes, int startpos)
      {
 /n ..... /n //View Source file for more details /n }

7. Example

Project: ZXing.Net
Source File: PDF417HighLevelEncoder.cs
View license
private static int determineConsecutiveTextCount(String msg, int startpos)
      {
         int len = msg.Length;
         int idx = startpos;
         while (idx < len)
         {
            char ch = msg[idx];
            int numericCount = 0;
            while (numericCount < 13 && isDigit(ch) && idx < len)
            {
               numericCount++;
               idx++;
               if (idx < len)
               {
                  ch = msg[idx];
               }
            }
            if (numericCount >= 13)
            {
               return idx - startpos - numericCount;
            }
            if (numericCount > 0)
            {
               //Heuristic: All text-encodable chars or digits are binary encodable
               continue;
            }
            ch = msg[idx];

            //Check if character is encodable
            if (!isText(ch))
            {
               break;
            }
            idx++;
         }
         return idx - startpos;
      }

8. Example

View license
private static int determineConsecutiveTextCount(String msg, int startpos)
      {
         int len = msg.Length;
         int idx = startpos;
         while (idx < len)
         {
            char ch = msg[idx];
            int numericCount = 0;
            while (numericCount < 13 && isDigit(ch) && idx < len)
            {
               numericCount++;
               idx++;
               if (idx < len)
               {
                  ch = msg[idx];
               }
            }
            if (numericCount >= 13)
            {
               return idx - startpos - numericCount;
            }
            if (numericCount > 0)
            {
               //Heuristic: All text-encodable chars or digits are binary encodable
               continue;
            }
            ch = msg[idx];

            //Check if character is encodable
            if (!isText(ch))
            {
               break;
            }
            idx++;
         }
         return idx - startpos;
      }

9. Example

Project: ZXing.Net
Source File: PDF417HighLevelEncoder.cs
View license
private static int determineConsecutiveBinaryCount(String msg, byte[] bytes, int startpos, Encoding encoding)
      {
         int len = msg.Length;
         int idx = startpos;
         int idxb = idx;  // bytes index (may differ from idx for utf-8 and other unicode encodings)
         encoding = getEncoder(encoding);
         while (idx < len)
         {
            char ch = msg[idx];
            int numericCount = 0;

            while (numericCount < 13 && isDigit(ch))
            {
               numericCount++;
               //textCount++;
               int i = idx + numericCount;
               if (i >= len)
               {
                  break;
               }
               ch = msg[i];
            }
            if (numericCount >= 13)
            {
               return idx - startpos;
            }
            ch = msg[idx];
            // .Net fallback strategie: REPLACEMENT_CHARACTER 0x3F
            if (bytes[idxb] == 63 && ch != '?')
            {
               throw new WriterException("Non-encodable character detected: " + ch + " (Unicode: " + (int) ch + ')');
            }
            idx++;
            idxb++;
            if (toBytes(ch, encoding).Length > 1)  // for non-ascii symbols
                idxb++;
         }
         return idx - startpos;
      }