mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
Normalize Unicode out of folder name (#39)
This commit is contained in:
@@ -44,7 +44,8 @@ public class VisionManager {
|
||||
VideoCapture cap = new VideoCapture(info.dev);
|
||||
if (cap.isOpened()) {
|
||||
cap.release();
|
||||
String name = info.name;
|
||||
// Filter non-ascii characters because ext4 doesn't play nice with unicode in directory names
|
||||
String name = info.name.replaceAll("[^\\x00-\\x7F]", "");
|
||||
while (usbCameraInfosByCameraName.containsKey(name)) {
|
||||
suffix++;
|
||||
name = String.format("%s (%d)", name, suffix);
|
||||
|
||||
Reference in New Issue
Block a user