Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8139030

Java supported Locales, UTF-8 unrecognized char 'Ə' 'ə'

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      Hi Java Bug reporting and fixing team. I want to report that in Java 8 and 7 (I didn't check older versions but I think older versions also) versions does not support Azerbaijan's locale.
      Azerbaijan's locale should be as 'az' and 'AZ'. Also it does not recognize char 'Ə' 'ə' .
      I wanna inform you that Turkish and Azerbaijani letters (Languages are similar we can understand each other) are almost same except they don't have 'Ə' 'ə' but we have. So, it should be easy to add Azerbaijani locale and character 'Ə' 'ə' to Java because it will not take your time that much to implement.

      JUSTIFICATION :
      Because it will help us to make easily programs that will not have problem with Azerbaijani language and locale.


      ---------- BEGIN SOURCE ----------
      -----------
      App class with main method
      --------------
      import java.io.File;
      import java.io.FileNotFoundException;
      import java.nio.charset.Charset;
      import java.nio.charset.StandardCharsets;
      import java.util.ArrayList;
      import java.util.Locale;
      import java.util.Scanner;
      public class App {

      public static void main(String[] args) throws FileNotFoundException {

      //C:\Users\User\CodeData\test.txt yerine C:/Users/User/CodeData/test.txt yazmaq olar
      String fileName = "C:/Users/User/CodeData/Java 04 - Hello World/test.txt";

      ArrayList<Player> players = new ArrayList<Player>();

      File file = new File(fileName);

      Locale loc = new Locale("az", "AZ");
      Charset ENCODING = StandardCharsets.UTF_8;
      Scanner input = new Scanner(file, ENCODING.name());
      input.useLocale(loc);

      int flag = 0;
      while(input.hasNext()){

      if(flag == 0){
      String inputLine = input.nextLine();
      System.out.println(inputLine);
      flag = 1;
      }


      int number = input.nextInt();
      String name = input.next();
      players.add(new Player(name, number));
      }
      input.close();

      for(Player p: players){
      System.out.println(p);
      }

      }

      }
      ----------
      Player class
      ------------------

      public class Player {
      private String name;
      private int jerseyNumber;

      public Player(String name, int jerseyNumber){
      this.name = name;
      this.jerseyNumber = jerseyNumber;
      }

      public String toString(){
      String output = name + " wears number " + jerseyNumber;
      return output;
      }
      }

      ------------
      test.txt file data
      --------------------
      28 Vüsal qüertyuiopöğasdfghjklıəzxcvbnmçş
      26 Səlmi
      1 Selcan
      26 Ənvər
      27 Gülnar
      56 Nizami
      52 Məlahət
      ---------- END SOURCE ----------

            okutsu Masayoshi Okutsu
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: