# Bank loading and unicode

**URL:** <https://qa.fmod.com/t/bank-loading-and-unicode/11517>\
**Category:** FMOD Studio\
**Created:** [June 24, 2014, 12:26pm UTC](https://qa.fmod.com/t/bank-loading-and-unicode/11517 "2014-06-24T12:26:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisaverage](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@chrisaverage](https://qa.fmod.com/u/chrisaverage)\
**Post date:** [June 24, 2014, 12:26pm UTC](https://qa.fmod.com/t/bank-loading-and-unicode/11517/1 "2014-06-24T12:26:30Z")

</div>

Is there a way to pass 2-byte unicode file path to the FMOD::Studio::System::loadBankFile like there is with FMOD\_UNICODE flag for FMOD::System::createSound?  
I know I can use FMOD::Studio::System::loadBankCustom, but I’d like to avoid redundant implementing of all the callbacks, since they would be pretty standard.

---

<div class="post-metadata">

**Author:** ![graeme](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@graeme](https://qa.fmod.com/u/graeme)\
**Post date:** [July 3, 2014, 4:30am UTC](https://qa.fmod.com/t/bank-loading-and-unicode/11517/2 "2014-07-03T04:30:32Z")

</div>

Currently the Studio API does not provide a way to specify a UTF-16 path to FMOD::Studio::System::loadBankFile().

We are planning to add full Unicode support to Studio in the near future. Actually we have decided on the UTF-8 standard, rather than UTF-16, as this encoding is more compatible with our existing API (which generally uses char\* for string arguments), and is somewhat more portable across all platforms. In any case, it is relatively easy to convert between UTF-16 and UTF-8 encodings.

For now, your best option is to use FMOD::Studio::System::loadBankCustom(), as you have suggested.

---

<div class="post-metadata">

**Author:** ![graeme](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@graeme](https://qa.fmod.com/u/graeme)\
**Post date:** [January 5, 2015, 3:46am UTC](https://qa.fmod.com/t/bank-loading-and-unicode/11517/3 "2015-01-05T03:46:25Z")

</div>

As of version 1.05.00, all FMOD functions dealing with file names and paths now accept UTF-8 encoded strings. All arguments that take or return UTF-16 encoded strings have actually been removed, as have related flags like FMOD\_UNICODE.

Now you can just use UTF-8 strings everywhere. If you have a UTF-16 (wide string) file path, just convert it to UTF-8 encoding and pass that to FMOD::Studio::System::loadBankFile().

On Windows, you could do something like…

```
FMOD::Studio::Bank* LoadBankWide(FMOD::Studio::System* system, const wchar_t* filenameW)
{
    char filename[MAX_PATH];
    WideCharToMultiByte(CP_UTF8, 0, filenameW, -1, filename, sizeof(filename), NULL, NULL);

    FMOD::Studio::Bank* bank = NULL;
    system->loadBankFile(filename, FMOD_STUDIO_LOAD_BANK_NORMAL, &bank);

    return bank;
}
```
