Lecture 7 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Do you know the difference between charset & encoding? Every programmer nowadays MUST understand these terms, how they work, and how to use them. Otherwise we constantly face broken software refusing to work with international characters properly.
Lecture 3 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Discusses more Java basics and Object Oriented Programming.
Lecture 15 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Gives an overview of more advanced Java topics.
Java Course 12: XML & XSL, Web & ServletsAnton Keks
Lecture 12 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Lecture 6 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Gives an overview how a software developer should organize their daily work, apart from technical skills.
Introduces Agile software development practices from XP and Scrum.
Lecture 3 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Discusses more Java basics and Object Oriented Programming.
Lecture 15 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Gives an overview of more advanced Java topics.
Java Course 12: XML & XSL, Web & ServletsAnton Keks
Lecture 12 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Lecture 6 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Gives an overview how a software developer should organize their daily work, apart from technical skills.
Introduces Agile software development practices from XP and Scrum.
Lecture 13 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Core Java Tutorial. In case you want to get trained in Spring Framework you can refer here:
<a href="https://www.emexotechnologies.com/courses/java-development-training/core-java-training/">Java Training</a>
Core Java introduction | Basics | free course Kernel Training
http://kerneltraining.com/core-java/
Learn the basics of Java and gain practical experience that is required to begin your career in java programming. Kernel Training has designed classroom and online course to upgrade your knowledge and skills in core Java.
Course Curriculum:
Introduction to Java
JDK and practical applications
Java Basic Data Types and Operators
Programming Constructs, Classes and Methods, constructor and Finalizer
Polymorphism
Inheritance
Method overriding and abstract classes
Packages and Interfaces
Strings and Arrays
Enums
Lecture 14 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Mahika Tutorials sharing PPT slide for core java programming language. Go threw this slide and visit our YouTube page too
https://www.youtube.com/c/mahikatutorials
Core Java Developer Certification helps demonstrate an individual's overall comprehension and expertise of Java programming language. VSkills Core Java Developer Certification holders have more than a working familiarity with Java programs—they are technically skilled to take advantage of the breadth of features efficiently and effectively.
http://www.vskills.in/certification/Certified-Core-Java-Developer
In this presentation we introduce topic of core java that is required to learn if you want to be good java programmer. i provide all concept in detail.
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Sagar Verma
16. Threads in Java
Non-Threaded Applications
Threaded Applications
Process based multitasking Vs Thread based multitasking
Thread API in Java
Creating Threads
States of a Thread
Synchronization for threads; static and non-static synchronized methods; blocks; concept of object and class locks
Coordination between threads - wait, notify and notifyAll methods for inter-thread communication
17. Applets
What are applets?
Need for Applets
Different ways of running an applet program
Applet API hierarchy
Life Cycle of an applet
Even Handlers for applets, mouse events, click events
18. Swing GUI
Introduction to AWT
Introduction to Swing GUI
Advantages of Swing over AWT
Swing API
Swing GUI Components
Event Handlers for Swing
Sample Calculator application using Swing GUI and Swing Event handling
19. JDBC
What is JDBC; introduction
JDBC features
JDBC Drivers
Setting up a database and creating a schema
Writing JDBC code to connect to DB
CRUD Operations with JDBC
Statement types in JDBC
Types of Rowset, ResultSet in JDBC
20. Access Modifiers in Java
What are access modifiers?
Default
Protected
Private
Public
Java history, versions, types of errors and exception, quiz SAurabh PRajapati
this ppt contains history and basic facts of object oriented programming language java, difference between JIT, JVM, JRE and JDK. it also having information about different versions of java. advantages over other language, difference between error and exception with its types is also included. explanation of final variable and string to int conversation is also added. in the end some twisted question of it which sharpen the knowledge of its basic are added. beyond this some programming examples with output is there too. hope u find it useful...!! thanku..!!
Lecture 11 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Describes goods and bads of software architecture as well as common design patterns.
This presentation covers all the basics of Java language. It is very helpful for the beginners. It includes a presentation on Java overview and its edition, where Java is used, an overview of class and object, A simple Java program and its execution, Java vs C++.
Lecture 13 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Core Java Tutorial. In case you want to get trained in Spring Framework you can refer here:
<a href="https://www.emexotechnologies.com/courses/java-development-training/core-java-training/">Java Training</a>
Core Java introduction | Basics | free course Kernel Training
http://kerneltraining.com/core-java/
Learn the basics of Java and gain practical experience that is required to begin your career in java programming. Kernel Training has designed classroom and online course to upgrade your knowledge and skills in core Java.
Course Curriculum:
Introduction to Java
JDK and practical applications
Java Basic Data Types and Operators
Programming Constructs, Classes and Methods, constructor and Finalizer
Polymorphism
Inheritance
Method overriding and abstract classes
Packages and Interfaces
Strings and Arrays
Enums
Lecture 14 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Mahika Tutorials sharing PPT slide for core java programming language. Go threw this slide and visit our YouTube page too
https://www.youtube.com/c/mahikatutorials
Core Java Developer Certification helps demonstrate an individual's overall comprehension and expertise of Java programming language. VSkills Core Java Developer Certification holders have more than a working familiarity with Java programs—they are technically skilled to take advantage of the breadth of features efficiently and effectively.
http://www.vskills.in/certification/Certified-Core-Java-Developer
In this presentation we introduce topic of core java that is required to learn if you want to be good java programmer. i provide all concept in detail.
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Sagar Verma
16. Threads in Java
Non-Threaded Applications
Threaded Applications
Process based multitasking Vs Thread based multitasking
Thread API in Java
Creating Threads
States of a Thread
Synchronization for threads; static and non-static synchronized methods; blocks; concept of object and class locks
Coordination between threads - wait, notify and notifyAll methods for inter-thread communication
17. Applets
What are applets?
Need for Applets
Different ways of running an applet program
Applet API hierarchy
Life Cycle of an applet
Even Handlers for applets, mouse events, click events
18. Swing GUI
Introduction to AWT
Introduction to Swing GUI
Advantages of Swing over AWT
Swing API
Swing GUI Components
Event Handlers for Swing
Sample Calculator application using Swing GUI and Swing Event handling
19. JDBC
What is JDBC; introduction
JDBC features
JDBC Drivers
Setting up a database and creating a schema
Writing JDBC code to connect to DB
CRUD Operations with JDBC
Statement types in JDBC
Types of Rowset, ResultSet in JDBC
20. Access Modifiers in Java
What are access modifiers?
Default
Protected
Private
Public
Java history, versions, types of errors and exception, quiz SAurabh PRajapati
this ppt contains history and basic facts of object oriented programming language java, difference between JIT, JVM, JRE and JDK. it also having information about different versions of java. advantages over other language, difference between error and exception with its types is also included. explanation of final variable and string to int conversation is also added. in the end some twisted question of it which sharpen the knowledge of its basic are added. beyond this some programming examples with output is there too. hope u find it useful...!! thanku..!!
Lecture 11 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Describes goods and bads of software architecture as well as common design patterns.
This presentation covers all the basics of Java language. It is very helpful for the beginners. It includes a presentation on Java overview and its edition, where Java is used, an overview of class and object, A simple Java program and its execution, Java vs C++.
Lecture 10 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
Interactive technical talk for the Agile Saturday VI.
Accompanied with live coding. All code is available on github: https://github.com/angryziber/patterns
Talk from Agile Saturday 3 event in Estonia.
It is about being professional in general as well as following agile best practices, such as build automation and continuous integration.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Java Course 7: Text processing, Charsets & Encodings
1. Java course - IAG0040
Text processing,
Charsets & Encodings
Anton Keks 2011
2. String processing
●
The following classes provide String processing:
String, StringBuilder/Buffer, StringTokenizer
●
All primitives can be converted to/from Strings using
their wrapper classes (e.g. Integer, Float, etc)
●
java.util.regex provides regular expressions
● java.text package provides classes and interfaces for
parsing and formatting text, dates, numbers, and
messages in a manner independent of natural
languages
Java course – IAG0040 Lecture 7
Anton Keks Slide 2
3. Locales
●
Java also supports locales, just like most OSs
●
A java.util.Locale object represents a specific
geographical, political, or cultural region.
– There is a default locale, which is used by some
String operations (e.g. toUpperCase) and formatters
in java.text package.
– Locale is initialized with: ISO 2-letter language code
(lower case), ISO 2-letter country code (upper case),
and a variant. Latter two are optional
● e.g. “de”, “et_EE”, “en_GB”
Java course – IAG0040 Lecture 7
Anton Keks Slide 3
4. Localization
● ResourceBundle classes can be used for
localization of your programs
– ResourceBundles contain locale-specific
objects, e.g. Strings
– ListResourceBundle and
PropertyResourceBundle are simple
implementations
– ResourceBundle.getBundle(...)
returns a locale-specific bundle
Java course – IAG0040 Lecture 7
Anton Keks Slide 4
5. Natural language comparison
● String.compareTo() does lexicographical
comparison, ie compares character codes
● Collators are used for locale-sensitive
comparison/sorting, according to the rules of
the specific language/locale
– java.text.Collator implements Comparator<String>
– Use Collator.getInstance(...) for obtaining one
– RuleBasedCollator is the common implementation,
allows specification of own rules
Java course – IAG0040 Lecture 7
Anton Keks Slide 5
6. StringBuffer vs String
●
A StringBuilder (and StringBuffer) is a mutable String
● Always use it, when doing complex String processing, especially when
doing a lot of concatenations in a loop
● Java uses StringBuilder internally in place of the '+' operator
– String s = a + b + 25; is the same as
– String s = new StringBuilder()
.append(a).append(b).append(25).toString();
– There are many different append() methods for all primitive types as well as
any objects. For an arbitrary object, toString() is called.
● StringBuffer, StringBuilder, and String implement CharSequence
● StringBuilder has the same methods as StringBuffer, but a bit faster,
because it is not thread safe (not internally synchronized)
Java course – IAG0040 Lecture 7
Anton Keks Slide 6
7. Formatting and Parsing
● Locale-specific formatting and parsing is provided by java.text.
● java.text.Format is an abstract base class for
– DateFormat (SimpleDateFormat) – date and time. Calendar is used for
manipulation of date and time.
– NumberFormat (ChoiceFormat, DecimalFormat) – numbers, currencies,
percentages, etc
– MessageFormat – for complex concatenated messages
– all of them provide various format and parse methods
– all of them can be initialized for the default or specified locale using
provided static methods
– all of them can be created directly, specifying the custom format
Java course – IAG0040 Lecture 7
Anton Keks Slide 7
8. Regular expressions
●
Regular expressions are expressions, allowing easy searching and matching
of textual data, they are built into many languages, like Perl and PHP, and
widely used in Unix command-line
● Regular expression classes are in the java.util.regex package.
● In Java, represented as Strings, but must be 'compiled' by
Pattern.compile() before use.
● However, many String methods provide convenient 'shortcuts', like
split(), matches(), replaceFirst(), replaceAll(), etc
● Pattern is an immutable compiled representation, which can be used for
creation of mutable Matcher objects.
● Use Patterns directly in case you intend to reuse the regexp
Java course – IAG0040 Lecture 7
Anton Keks Slide 8
9. Regular Expressions (cont)
●
Read javadoc of the Pattern class!
– . (a dot) matches any character
– [] can be used for matching any specified character
– s, S, d, w, etc save you typing sometimes (note: double escaping
is needed within String literals, e.g. “s”
– ?, +, * match the number of occurrences of the preceding character:
0 or 1, 1 or more, any number respectively
– () - matches groups (they can be accessed individually)
– | means 'or', e.g. (dog|cat) matches both “dog” and “cat”
– ^ and $ match beginning and end of a line, respectively
– b matches word boundary
Java course – IAG0040 Lecture 7
Anton Keks Slide 9
10. Scanning
●
java.util.Scanner can be used for parsing Strings, InputStreams, Readers, or
Files
●
It uses either built-in or custom regular expressions for parsing input data, it is
sensitive to either the default or specified Locale
● Default delimiter is whitespace (“s”), custom delimeter may be set using
the useDelimiter() method
● It implements Iterator<String>, therefore has hasNext() and next()
methods, various type-specific methods, e.g. hasNextInt(), nextInt(),
etc, as well as finding and skipping facilities
●
Can be used for parsing the standard input:
– Scanner s = new Scanner(System.in);
int n = s.nextInt();
Java course – IAG0040 Lecture 7
Anton Keks Slide 10
11. Charsets and encodings
●
In the 21st century, there is no excuse for any programmer
not to know charsets and encodings well
●
Charsets map glyphs (symbols) to numeric codes
●
Charsets are represented by character encodings (actual
bits and bytes that are stored in files)
●
Fonts must support charsets in order to display texts in
respective encodings properly
●
Example:
– Glyph (symbol): A
– Numeric code: 65 (ASCII charset)
– Encoding: 0x41 == 1000001 b (ASCII 7-bit encoding)
Java course – IAG0040 Lecture 7
Anton Keks Slide 11
12. ASCII
●
American Standard Code for Information Interchange
●
Created in 1963, ANSI in 1967, ISO-646 in 1972
●
Allowed for text exchange between computers
● Only 7 bits are defined, nowadays called US-ASCII
●
0-31 – control chars
●
33-126 – printable
●
Was designed for
English language
Java course – IAG0040 Lecture 7
Anton Keks Slide 12
13. ASCII extensions
●
ASCII is enough for only Latin, English, Hawaiian and Swahili
●
For most other languages a number of 8-bit ASCII extensions
were developed, incompatible with each other
● ISO-8859 was an attempt to standardize them by defining the
upper 128 characters in 8-bit wide bytes
– All of them have the first 7-bit the same as ASCII
– ISO-8859-1 (Latin-1) – Western European
– ISO-8859-4 – Northern, ISO-8859-13 – Baltic,
WIN-1257 – MS Baltic (modified ISO)
– ISO-8859-5, KOI8-R – Cyrillic,
WIN-1251 – MS Cyrillic (different from ISO)
– Many of them are still used today in legacy systems or formats
Java course – IAG0040 Lecture 7
Anton Keks Slide 13
14. Unicode (UCS, ISO-10646)
●
Unicode solves the problem of incompatible charsets
●
Unicode defines standardized numeric codes (code
points) for most glyphs used in the world
– Code points are abstract – they don't define representation
– First 256 code points correspond to ISO-8859-1
– 16 bit BMP (Basic Multilingual Plane) – most modern
languages (including Chinese, Japanese, etc)
– More planes for other scripts (mathematical symbols,
musical notation, ancient alphabets, etc)
● Apart from UCS, Unicode defines formatting and
combining rules as well (e.g. for bidirectional text)
Java course – IAG0040 Lecture 7
Anton Keks Slide 14
15. Unicode encodings
●
Define representation of code points in bits and bytes
●
Fixed-width UCS-2 (2 bytes) and UCS-4 (4 bytes)
●
UTF (Unicode Transformation Format)
– All of them can encode any Unicode code points
– UTF-8 – variable size from 1 to 6 bytes (usually no longer
than 3 bytes, compatible with ASCII), the most popular and
compact
– UTF-16 – 2 or 4 bytes, 2 bytes for BMP code points, 4 bytes
for other planes
– UTF-32 – constant size, 4 bytes per character, 'raw' unicode
– UTF-7 – 7-bit safe encoding (less popular nowadays)
Java course – IAG0040 Lecture 7
Anton Keks Slide 15
16. Charsets and Java
● char and String are UTF-16
– Beware that length(), indexOf(), etc operate on chars (surrogates), not
Unicode glyphs, therefore can return 'logically wrong' values in case of
4-byte characters – this was a performance decision
● Encoding conversions are built-in
– Encoded text is binary data for Java, therefore stored in bytes
– There always exists the default encoding (the one OS uses)
– Charset class is provided for encoding/decoding, enumeration, etc
– s.toBytes(...) - encodes a String
– new String(...) - decodes raw bytes to a String
– System.out and System.in automatically convert to/from the default
encoding
Java course – IAG0040 Lecture 7
Anton Keks Slide 16