Handle Special Characters - x360Sync

Written By Tami Sutcliffe (Super Administrator)

Updated at July 28th, 2021

Overview

Windows does not allow the following characters when naming files and folders:

  \ / * ? “ < > | 

Mac and Linux OS systems, however, do allow these characters. As such, Windows (and Apache, to a degree) needs to handle these characters in the event that they are synced to the server and then synced down to a Windows system.

How Windows Handles Special Characters

Windows handles this issue by substituting each offending character with an underscore (“_”), adding a tilde (“~”) at the end of the file name, and then finally adding a numerical code for each offending character after the tilde. Numerical codes are defined as follows:

Special Character

Numerical Code

\

00

/ or :

01

*

02

?

03

04

05

06

|

07

Carriage return

08

Trailing spaces

09

For example, the following file names would be translated as: 

Mac/Linux file name

Windows translation

Quest?ion.txt

 Quest_ion.txt~03

Asteri*sk.txt

 Asteri_sk.txt~02

Double Aste*ri*sks.txt

Double Aste_ri_sks.txt~0202

All charact\/*?”<>|ers.txt

All charact________ers.txt~0001020304050607

How Apache Handles Special Characters

Apache handles all of these special characters as they are originally created, except for the slash (“/”) character. On the web interface, this character is substituted with a colon (“:”) in every instance that it occurs. For example, a file name with this character is translated as:

Mac/Linux file name

Apache Web

Windows translation

File/name.txt

File:name.txt

 File_name.txt~01