Skip to content

Commit

Permalink
[1.5.1] Add logs for when falling back to Charset method
Browse files Browse the repository at this point in the history
  • Loading branch information
Wirtos committed Dec 10, 2024
1 parent 13a6433 commit a9450f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ android {
applicationId "com.wirtos.tguydroid"
targetSdkVersion 35
minSdkVersion 16
versionCode 7
versionName '1.5.0'
versionCode 8
versionName '1.5.1'
archivesBaseName = "$applicationId-$versionName"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/wirtos/tguydroid/TGuy.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.wirtos.tguydroid;

import android.os.Build;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

Expand Down Expand Up @@ -36,6 +36,7 @@ public class TGuy {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
res = str.getBytes(StandardCharsets.UTF_8);
} else {
Log.i("TGUYDROID", "TGuy() Falling back to Charset");
res = str.getBytes(Charset.forName("UTF-8"));
}
tgobj = tguy_jni_ctor(res, spacing);
Expand All @@ -59,6 +60,7 @@ public String toString() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return new String(res, StandardCharsets.UTF_8);
} else {
Log.i("TGUYDROID", "toString() Falling back to Charset");
return new String(res, Charset.forName("UTF-8"));
}
}
Expand Down

0 comments on commit a9450f0

Please sign in to comment.