Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turkish locale system cannot build ChronicleMap #476

Open
OguzhanOktayBuyuk opened this issue Mar 9, 2023 · 4 comments
Open

Turkish locale system cannot build ChronicleMap #476

OguzhanOktayBuyuk opened this issue Mar 9, 2023 · 4 comments
Assignees
Labels

Comments

@OguzhanOktayBuyuk
Copy link

An error arose while attempting to utilize Chronicle Map as a client. The process involves generating Chronicle Map while configuring JVM parameters as "-Duser.language=tr -Dfile.encoding=UTF-8". During the build process, the program branches into the CachedCompiler class, located in the Chronicle-Values package, and attempts to read the VanillaGlobalMutableState$$Native.class file. However, the file contains characters which are inconsistent with Turkish conventions, as the lowercase letter "i" is converted to the uppercase character "İ". (example: writeİnt instead of writeInt)

Potential problematic place (diagnostic just gives the reason that it cannot read the file appropriately):

CompilerUtils.s_compiler.getTask(null, fileManager, diagnostic -> {
            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
                errors = true;
                System.err.println(diagnostic);
            }
        }, compilerOptions, null, compilationUnits).call();

In this code snippet there is a fileManager which is a custom file manager named MyJavaFileManager. I think there is a localization problem in this class.

I found a workaround for the problem but it is not a good solution (just for people who have a localization problem can try it). Before I build ChronicleMap, I read my location by Location.getDefault() and store it in a temporary variable. After ChronicleMap was built, I set my location Location.setDefault(temporaryVariable).
Example:

Locale locale = Locale.getDefault();
Locale.setDefault(Locale.ENGLISH);
---- ChronicleMapBuilder code ---
Locale.setDefault(locale);
@JerryShea
Copy link
Contributor

Hi @OguzhanOktayBuyuk. Are you interested in trying to diagnose further and/or even come up with a patch to fix the problem?

@OguzhanOktayBuyuk
Copy link
Author

Hi @JerryShea,

Yes, I am interested in trying to diagnose and finding a bugfix for this problem. I will try to find out.

@JerryShea
Copy link
Contributor

@OguzhanOktayBuyuk any news on this?

@JerryShea
Copy link
Contributor

@OguzhanOktayBuyuk please take a look at OpenHFT/Chronicle-Values#53 which @yevgenp has worked up. Are you able to test his PR against your use case to confirm everything works as expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants