• Like
  • Save
  • Private Content
Haxe vs Unicode
Upcoming SlideShare
Loading in...5
×
 

Haxe vs Unicode

on

  • 43 views

HaxeでUnicode文字列を取り扱う際に直面する闇

HaxeでUnicode文字列を取り扱う際に直面する闇

Statistics

Views

Total Views
43
Views on SlideShare
43
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Haxe vs Unicode Haxe vs Unicode Presentation Transcript

    • Ryusei @mandel59 筑波大生 某校コン部OB
    • Haxe vs Unicode Ryusei Yamaguchi @mandel59
    • Haxe 見た目はAconScript パターンマッチがある 型推論がある 一般化代数データ型 (GADTs) がある
    • https://github.com/HaxeFoundation/haxe/pull/2759#issue-29453259
    • Haxeのターゲット Adobe Flash C++ C# Java JavaScript Neko VM PHP Python 3
    • class Hello { public static function main() { trace("Hello, 世界🌏".length); } }
    • 環境依存のコード class Hello { public static function main() { trace("Hello, 世界🌏".length); } } 1117 10
    • Encoding Formsの違い 0000 0041 0000 042F 0000304B 00029E3D 0041 042F 304B D867 DE3D 41 D0 AF E3 81 8B F0 A9 B8 BD
    • Indexの数え方の違い 0 1 2 3 41 D0 AF E3 81 8B F0 A9 B8 BD 0 1 2 3 4 5 6 7 8 9
    • Indexの数え方の違い 0 1 2 3 41 D0 AF E3 81 8B F0 A9 B8 BD 0 1 2 3 4 5 6 7 8 9 s.substr(2, 2) s.substr(3, 7)
    • ターゲットごとの仕様
    • 環境ごとの仕様 11 17 10
    • Issue #3072 Unicode support https://github.com/HaxeFoundation/haxe/issues/3072#issue-34554043
    • haxe.Utf8 by Code Points操作を提供する
    • haxe.Utf8 現状UTF-8環境でしか使えない! クロスプラットフォームじゃないじゃん
    • haxe.Utf8 decodeは可変長のUTF-8を固定長の ISO-8859-1に変換するメソッド encodeは固定長のISO-8859-1を(ry
    • haxe.Utf16 未実装
    • haxe.Ucs2 そもそもUCS-2はdeprecated なんで今更導入するんだ
    • haxe.Ucs2 JSやFlashがUCS-2? いやUTF-16でしょ?
    • haxe.Ucs2 固定長だからO(1)アクセス? 文字列処理全体のオーダーは?
    • 想定される使い方 ネイティブ Sing haxe.Ucs2 変換 処理 haxe.Ucs2 変換 ネイティブ Sing
    • 問題点 使い方が面倒くさい
    • Unifill using unifill.Unifill; class Hello { public static function main() { trace("Hello, 世界🌏”.uLength()); } }
    • Unifillの使い方 ネイティブ Sing Unifillのメソッドで処理 ネイティブ Sing
    • Unifill using unifill.Unifill; class Hello { public static function main() { trace("Hello, 世界🌏”.uLength()); } } 1010 10
    • 課題 Unifillの仕組みを標準APIに入れる 現在の標準APIは地雷 実装の洗練・最適化を行う
    • ank you!