블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-19 00:04

[링크] https://snack.planetarium.dev/kor/2020/02/thai-in-2562/

 

태국에서만 2562년으로 가는 소프트웨어?

 

snack.planetarium.dev

 

[참조] https://stackoverflow.com/questions/13903967/datetime-now-touniversaltime-has-the-wrong-year

 

DateTime.Now.ToUniversalTime() Has the Wrong Year

And Idea Why the Year appears as 2555? The culture of the site is Thai

stackoverflow.com

[참조] https://stackoverflow.com/questions/30393668/thai-year-2558-to-2015

 

Thai year 2558 to 2015

How to transform buddhist format of datetime into gregorian format (e.g. for Thailand 2558 → 2015)? using System.Text; using System.Threading; using System.Threading.Tasks; namespace

stackoverflow.com

 

반응형
Posted by blueasa
, |

exception : Not a valid calendar for the given culture. Parameter name: value

 

---------------------------------------------------------------------------------------

 

iOS에서 시스템 언어가 태국어(Thai) 일 때, 위와 같은 에러가 나서 확인해보니,

il2cpp에서 태국어 일 때 CultureInfo를 제대로 생성 못하는 버그가 있다고 한다.

 

그래서 [참조] 링크의 내용을 참조해서 아래와 같이 소스를 넣고, 앱 시작 시 실행하도록 소스를 추가 했다.

(아랍어도 같은 이슈가 있다고 해서 소스를 같이 추가함)

 

    public static void InitArabicCalendarCrashFix()
    {
        // Two Letter ISO Language
        string strTwoLetterISOLanguage = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
        Debug.LogFormat("[CurrentCulture.strTwoLetterISOLanguage] {0}", strTwoLetterISOLanguage);
        if (strTwoLetterISOLanguage == "ar")
        {
            new System.Globalization.UmAlQuraCalendar();
        }

        // CultureName
        //string strCurrentCultureName = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
        //Debug.LogFormat("[CurrentCulture.Name] {0}", strCurrentCultureName);
        //if (strCurrentCultureName == "ar-SA")
        //{
        //    new System.Globalization.UmAlQuraCalendar();
        //}
    }

    public static void InitThaiCalendarCrashFix()
    {
        // Two Letter ISO Language
        string strTwoLetterISOLanguage = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
        Debug.LogFormat("[CurrentCulture.strTwoLetterISOLanguage] {0}", strTwoLetterISOLanguage);
        if (strTwoLetterISOLanguage == "th")
        {
            new System.Globalization.ThaiBuddhistCalendar();
        }

        // CultureName
        //string strCurrentCultureName = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
        //Debug.LogFormat("[CurrentCulture.Name] {0}", strCurrentCultureName);
        //if (strCurrentCultureName == "th-TH")
        //{
        //    new System.Globalization.ThaiBuddhistCalendar();
        //}
    }

 

 

 

[참조]

forums.xamarin.com/discussion/42899/datetime-tostring-throws-argumentoutofrangeexception-in-thai-locale

 

DateTime.ToString() throws ArgumentOutOfRangeException in Thai locale

Hi, We're seeing an issue when our app is being used on iOS when in the Thai locale, seemingly down to the DateTime.ToString() method throwing an ArgumentOutOfRangeException with the message "Not a valid calendar for the given culture".

forums.xamarin.com

 

반응형
Posted by blueasa
, |