utf16string - Rust - Docs.rs
文章推薦指數: 80 %
However different CPU architectures encode these u16 integers using different byte order: little-endian and big-endian. Thus when handling UTF-16 strings you ...
Docs.rs
utf16string-0.2.0
utf16string0.2.0
Permalink
Docs.rscratepage
MITORApache-2.0
Links
Repository
Crates.io
Source
Owners
flub
Dependencies
byteorder^1
normal
Versions
0.2.0
0.1.0
100.0%
ofthecrateisdocumented
Platform
x86_64-unknown-linux-gnu
i686-unknown-linux-gnu
x86_64-pc-windows-msvc
x86_64-apple-darwin
i686-pc-windows-msvc
Featureflags
Releases
AllReleases
ReleasesbyStars
RecentBuildFailures
BuildFailuresbyStars
ReleaseActivity
Rust
Rustwebsite
TheBook
StandardLibraryAPIReference
RustbyExample
TheCargoGuide
ClippyDocumentation
Aboutdocs.rs
Privacypolicy
Buildqueue
☰Crateutf16stringVersion0.2.0Seeallutf16string'sitemsStructsEnumsTraitsTypeDefinitions?
[−][src]Crateutf16stringAUTF-16little-endianstringtype.
ThiscrateprovidestwostringtypestohandleUTF-16encodedbytesdirectlyasstrings:
WStringandWStr.TheyaretoUTF-16exactlylikeStringandstrareto
UTF-8.Someoftheconceptsandfunctionshereareratherterselydocumented,inthis
caseyoucanlookuptheirequivalentsonStringorstrandthebehaviourshould
beexactlythesame,onlytheunderlyingbyteencodingisdifferent.
ThusWStringisatypewhichownsthebytescontainingthestring.Justlike
StringandtheunderlyingVecitisbuilton,itdistinguisheslength
(WString::len)andcapacity(String::capacity).Herelengthisthenumberof
bytesusedwhilecapacityisthenumberofbytesthestringcangrowwithouth
reallocating.
TheWStrtypedoesnotownanybytes,itcanonlypointtoasliceofbytes
containingvalidUTF-16.Assuchyouwillonlyeveruseitasareferencelike&WStr,
justyouyouonlyusestras&str.
TheWStringtypeimplementsDeref
延伸文章資訊
- 1UTF-16 - Wikipedia
UTF-16 (16-bit Unicode Transformation Format) is a character encoding capable of encoding all 1,1...
- 2Unicode character encoding - IBM
- 3Db2 12 - Internationalization - UTFs
UTF-16 is based on 16-bit code units. Each character is encoded as at least 2 bytes. Some charact...
- 4Difference between UTF-8, UTF-16 and UTF-32 Character ...
The main difference between UTF-8, UTF-16, and UTF-32 character encoding is how many bytes it req...
- 5UTF-8, UTF-16, and UTF-32 - unicode - Stack Overflow