Coder Social home page Coder Social logo

unicode-eyuyan's Introduction

Unicode-Eyuyan

一个进行 Unicode 相关字符串转换的易语言库。

An Eyuyan library dealing with Unicode string conversion.

背景 Background

易语言是一个面向初学者的编程语言,其源代码使用中文字符书写。然而,直至版本 5.5,易语言还在使用 Win32 ANSI API 处理字符串,迟迟未加入 Unicode 支持,给生僻汉字、外国文字处理带来不便。

Eyuyan is a programming language for beginners, whose source code is written in Chinese characters. However, Eyuyan was always using Win32 ANSI API to process strings, and has never supported Unicode, which made it difficult to deal with multi-language context.

使用方法 Usage

笔者认为你已经有 C 等高级编程语言的基础,因为某些原因迫不利己而使用易语言。

本库提供 Unicode.eUnicode.txt 两个文件。因为易语言源代码是二进制格式,所以后者是前者的文本导出版,实际内容相同。

因为 Windows 使用 UTF-16 Little Endian 来表示 Unicode 字符串,所以本库提供 UTF-8 和 ANSI 到 UTF-16 的转换。

在转换到 UTF-16 后,可以传入 Win32 Wide API 来使用。

.局部变量 我的ANSI字符串, 文本型
.局部变量 我的UTF8字符串, 字节集
.局部变量 转换自ANSI, 字节集
.局部变量 转换自UTF8, 字节集

' 定义一个 ANSI 字符串
我的ANSI字符串“你好,世界!”

' 定义一个 UTF-8 字符串
我的UTF8字符串{ 228, 189, 160, 229, 165, 189, 239, 188, 129 }

' 把字符串转成 UTF-16
转换自ANSIANSI转UTF16 (我的ANSI字符串)
转换自UTF8UTF8转UTF16 (我的UTF8字符串)

' 调用 MessageBoxW 函数
MessageBoxW (0, 0, 字节集加零 (转换自ANSI), 字节集加零 (转换自UTF8), 64)

协议 License

本库以 BSD 协议发布,参见随附的 LICENSE.txt 文件。

This library is released under BSD license. Please see the LICENSE.txt file, which is provided in this package.

unicode-eyuyan's People

Contributors

m13253 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.