I am trying different cultures in spanish language and testing some latin and south american cultures.
When using "es-MX" culture the console shows me correctly the date, but when using "es-CO" culture the console shows me some unkown characters.
The following code samples shows the result obtained when executing:
class Program
{
static void Main(string[] args)
{
//Mexico Culture
CultureInfo culture = new CultureInfo("es-MX");
DateTime today = DateTime.Today;
string dateFormat = today.ToString(culture);
Console.WriteLine(dateFormat);
//Result: 02/04/2025 12:00:00 a. m.
Console.ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
//Colombia Culture
CultureInfo culture = new CultureInfo("es-CO");
DateTime today = DateTime.Today;
string dateFormat = today.ToString(culture);
Console.WriteLine(dateFormat);
//Result: 2/04/2025 12:00:00?a.?m.
Console.ReadLine();
}
}
Can anybody tell me how to change any configuration to prevent that unknown characters?
Encoding.UTF8.GetBytes. Same bytes, same string