mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
64 lines
1.7 KiB
Java
64 lines
1.7 KiB
Java
|
package com.google.zxing.datamatrix.encoder;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes3.dex */
|
||
|
public final class TextEncoder extends C40Encoder {
|
||
|
@Override // com.google.zxing.datamatrix.encoder.C40Encoder, com.google.zxing.datamatrix.encoder.Encoder
|
||
|
public int getEncodingMode() {
|
||
|
return 2;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.zxing.datamatrix.encoder.C40Encoder
|
||
|
int encodeChar(char c, StringBuilder sb) {
|
||
|
if (c == ' ') {
|
||
|
sb.append((char) 3);
|
||
|
return 1;
|
||
|
}
|
||
|
if (c >= '0' && c <= '9') {
|
||
|
sb.append((char) (c - ','));
|
||
|
return 1;
|
||
|
}
|
||
|
if (c >= 'a' && c <= 'z') {
|
||
|
sb.append((char) (c - 'S'));
|
||
|
return 1;
|
||
|
}
|
||
|
if (c < ' ') {
|
||
|
sb.append((char) 0);
|
||
|
sb.append(c);
|
||
|
return 2;
|
||
|
}
|
||
|
if (c <= '/') {
|
||
|
sb.append((char) 1);
|
||
|
sb.append((char) (c - '!'));
|
||
|
return 2;
|
||
|
}
|
||
|
if (c <= '@') {
|
||
|
sb.append((char) 1);
|
||
|
sb.append((char) (c - '+'));
|
||
|
return 2;
|
||
|
}
|
||
|
if (c >= '[' && c <= '_') {
|
||
|
sb.append((char) 1);
|
||
|
sb.append((char) (c - 'E'));
|
||
|
return 2;
|
||
|
}
|
||
|
if (c == '`') {
|
||
|
sb.append((char) 2);
|
||
|
sb.append((char) (c - '`'));
|
||
|
return 2;
|
||
|
}
|
||
|
if (c <= 'Z') {
|
||
|
sb.append((char) 2);
|
||
|
sb.append((char) (c - '@'));
|
||
|
return 2;
|
||
|
}
|
||
|
if (c <= 127) {
|
||
|
sb.append((char) 2);
|
||
|
sb.append((char) (c - '`'));
|
||
|
return 2;
|
||
|
}
|
||
|
sb.append("\u0001\u001e");
|
||
|
return encodeChar((char) (c - 128), sb) + 2;
|
||
|
}
|
||
|
}
|