Unicode to Ansi/Ascii

Have a suggestion for "Everything"? Please post it here.
fabioq
Posts: 22
Joined: Wed Dec 02, 2009 5:59 am

Unicode to Ansi/Ascii

Post by fabioq »

This maybe a weird suggestion, and I'm not sure if it's possible. I use Everything to search karaoke songs within certain folders and have a karaoke application that allows me to drop songs into its player. This is a karaoke hosting program, so it's not just a simple player. It has the ability to track several singers and rotations. It's a great application, except the developer is no longer working on it, and it won't accept songs where the filename is in UNICODE, unless I temporarily rename the file to an ASCII filename, and then I can play it. Ideally, I'm looking for Everything to temporarily create this filename as I click and drag it...maybe by right-click and drag or by holding the control/alt or some other key combination as I drag it. The file name itself doesn't have to be meaningful...it can be a random filename or can be a filename like "song1" and the number can be incremented since I'm guessing Everything will have to create a temporary file in some temporary folder which will be deleted when Everything is closed or if a file is older than a day. This would prevent it being deleted if everything is accidentally closed. Since Everything can now handle plugins, maybe this can be written as a plugin? I'm not a developer, but I'd be willing to pay for someone to build this plugin.

-Fabio
horst.epp
Posts: 1643
Joined: Fri Apr 04, 2014 3:24 pm

Re: Unicode to Ansi/Ascii

Post by horst.epp »

A very special function which is not worth the effort.
There are tools which make the change on the fly,
which can be used in a batch file to play the song.
fabioq
Posts: 22
Joined: Wed Dec 02, 2009 5:59 am

Re: Unicode to Ansi/Ascii

Post by fabioq »

Yeah, I figured it's not very useful function for more than a handful of people. I've googled for such a tool as you mentioned, but I've yet to find something. Do you have any links to such a tool?

Back to Everything... Perhaps something to run a batch or powershell script based on a file. I bet there would be more people interested in running a batch or powershell off of Everything. I'd be able to run the above-mentioned batch directly off Everything. 😁

Fabio
horst.epp
Posts: 1643
Joined: Fri Apr 04, 2014 3:24 pm

Re: Unicode to Ansi/Ascii

Post by horst.epp »

It's not trivial, since not every Unicode char has an ASCII equivalent.

I think the best chance is using some Python script.
Examples:
https://www.geeksforgeeks.org/convert-u ... ref=ml_lbp

There are also PowerShell examples in the Net.

Years ago I had a simple tool for this, but currently I don't find it.
NotNull
Posts: 5961
Joined: Wed May 24, 2017 9:22 pm

Re: Unicode to Ansi/Ascii

Post by NotNull »

- What is the name of this karaoke application?
- Do you use Everything exclusively for karaoke on this system?
- Do these karaoke files currently have specific extensions (and is that required)?
pilafpilaf
Posts: 2
Joined: Tue Mar 11, 2025 9:51 pm

Re: Unicode to Ansi/Ascii

Post by pilafpilaf »

Check out iconv, available as a command line tool in cygwin or WSL, or as a standalone port or embedded as a function in PHP.

It can convert to the nearest visual ASCII equivalent without complaining about how the actual letters are different, which is very often what you want.

For characters that lack similar ASCII (e.g. Kanji), you supply a catch-all default (in the examples below, it's underscore).

Code: Select all

echo "Mижnage ид 3" | iconv -f utf-8 -t ascii//TRANSLIT --unicode-subst=_
24 M__nage __ 3

echo "BØRNS - Electric Love" | iconv -f utf-8 -t ascii//TRANSLIT --unicode-subst=_
BORNS - Electric Love
fabioq
Posts: 22
Joined: Wed Dec 02, 2009 5:59 am

Re: Unicode to Ansi/Ascii

Post by fabioq »

horst.epp wrote: Sat Mar 15, 2025 11:25 am It's not trivial, since not every Unicode char has an ASCII equivalent.

I think the best chance is using some Python script.
Examples:
https://www.geeksforgeeks.org/convert-u ... ref=ml_lbp

There are also PowerShell examples in the Net.
Thanks for the suggestion. For the record the temporary file name doesn't have to be equivalent as the file name is temporary just to load it into the karaoke program and play it, then it can be deleted.
fabioq
Posts: 22
Joined: Wed Dec 02, 2009 5:59 am

Re: Unicode to Ansi/Ascii

Post by fabioq »

NotNull wrote: Sat Mar 15, 2025 3:49 pm - What is the name of this karaoke application?
- Do you use Everything exclusively for karaoke on this system?
- Do these karaoke files currently have specific extensions (and is that required)?
The Karaoke application is Virtual DJ Studio. The "Studio" part is relevant as there is well known Virtual DJ which is more for DJs than karaoke and does handle UNICODE. The Studio version is by a completely different company, not associated with the non-STUDIO version. The one I use is geared more towards karaoke and even has a built-in online request system, which I prefer. There are other karaoke hosting applications that do handle UNICODE, but they don't fit my hosting style. Anyway, I do use Everything for karaoke exclusively. I love the ability to create filters for basically anything. I have a filter for KARAOKE, MUSIC, HALLOWEEN, ST.PADDY, CHRISTMAS....etc. Karaoke files have either a ZIP extension or an MP4 extension. The zip files are actual zip files that contain two files, an MP3 and a CDG file (extensions). But I never have to unzip them. The karaoke app already knows them as karaoke. But as I'm typing this, I now realize that if the internal files are in UNICODE, the karaoke program won't load them or play them either, regardless that the external file has been renamed. So perhaps they need to be unzipped and renamed. Since the karaoke app can play them unzipped (as long as the two file names are matching -- minus the extensions) it will happily play them as karaoke. So in this situation, the external file really doesn't need to be renamed to ASCII...just the two internal files.

Fabio
fabioq
Posts: 22
Joined: Wed Dec 02, 2009 5:59 am

Re: Unicode to Ansi/Ascii

Post by fabioq »

pilafpilaf wrote: Sat Mar 15, 2025 7:55 pm Check out iconv, available as a command line tool in cygwin or WSL, or as a standalone port or embedded as a function in PHP.

It can convert to the nearest visual ASCII equivalent without complaining about how the actual letters are different, which is very often what you want.

For characters that lack similar ASCII (e.g. Kanji), you supply a catch-all default (in the examples below, it's underscore).

Code: Select all

echo "Mижnage ид 3" | iconv -f utf-8 -t ascii//TRANSLIT --unicode-subst=_
24 M__nage __ 3

echo "BØRNS - Electric Love" | iconv -f utf-8 -t ascii//TRANSLIT --unicode-subst=_
BORNS - Electric Love
Wow, this looks promising! I'll play around with it!