Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-33522

Cyrillic text not supported for Windows in native extension

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Won't Fix
    • Apache Flex 4.9.0
    • None
    • None
    • Windows / Air

    Description

      Pre-requisites:

      • a simple native extension that opens a file. The file path is send by the client Air app to the native extension.
      • windows environment with cyrillic text (e.g. russian)
      • a file in a folder with cyrillic name is it's path. (e.g. "Сергей Голиков")

      The native extension uses this code to parse the path:

      C code:

      — START CODE ----

      FILE * hd_src = NULL;
      const uint8_t* str = 0;
      uint32_t len = -1;
      FREObject filename = argv[1 ];
      FREGetObjectAsUTF8( filename, &len, &str );
      wchar_t * filepath = (wchar_t *)str;

      fopen_s(&hd_src, transferObject->filePath.c_str(), "rb");

      if (hd_src == NULL) {
      _wfopen_s(&hd_src,filePath, L"rb, ccs=UTF-8" );
      }
      if (hd_src == NULL) {
      _wfopen_s(&hd_src,filePath, L"rb, ccs=UNICODE" );
      }
      if (hd_src == NULL) {
      _wfopen_s(&hd_src,filePath, L"rb, ccs=UTF-16LE" );
      }

      ---- END CODE —

      hd_src is always null. If you save the parsed file path to a txt file, the characters are shown correctly. If you open a file without cyrillic text it opens correctly.

      In mac os, because of the Unix encoding the file opens correctly.

      Expected behavior is that the file also gets open in windows environment.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            woodwing_dev Woodwing Developer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment