wtf-8 | The WTF-8 encoding specification
kandi X-RAY | wtf-8 Summary
kandi X-RAY | wtf-8 Summary
The WTF-8 encoding specification
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of wtf-8
wtf-8 Key Features
wtf-8 Examples and Code Snippets
Community Discussions
Trending Discussions on wtf-8
QUESTION
Does anyone have experience publishing a .NET/Angular project to Netlify? I'm using the Angular Microsoft.AspNetCore.SpaTemplates template. On Netlify, I'm getting a non-zero exit code that's preventing me from publishing. Here is my output:
...ANSWER
Answered 2019-Jan-30 at 21:21Disclaimer: I work for Netlify
As we mentioned to you in your helpdesk ticket on this same topic, our deploy environment is very naked - you have to:
- specify dependencies that we can automatically install - npm/yarn deps, bower deps, gems and python packages.
- install other dependencies yourself. the 'dotnet' program will be one of this type. We don't have it in our install environment, so you need to somehow import a copy of it into the environment. Seems like you can download the entire SDK here: https://www.microsoft.com/net/download/linux and then you need to import ONLY what is necessary for your build - it will take a very long time to build your site if we have to download the entire SDK, so see what you can trim down to get 'dotnet' to run.
For the purposes of #2, you'll probably need to test things in our build environment. How to do that, and details you'll need about the build environment such as OS type so you can download the right version of the SDK are described in this article:
https://www.netlify.com/blog/2016/10/18/how-our-build-bots-build-sites/
This will take some work on your part. It will not be trivial. It is not something we can help with in more detail than that for free customers unless you come with specific questions and examples.
To address some thoughts in the comments:
- build.sh is indeed our build script
- 9:46:52 AM: /opt/build/build.sh: line 427: dotnet: command not found means that literally there is no dotnet command available to run - not that some config file is missing.
- we only try to run it once since you have set your command to use
&&
to chain several commands - one fails, the whole chain fails, and we don't need to run it two more times once the first failure occurs :)
QUESTION
I have an std::ffi::OsString
on Windows, but I need to pass a std::ffi::CString
to an FFI function. Is there any way to convert the OsString
into the CString
?
I know that on Windows, OsString
is backed by a WTF-8-encoded buffer. Essentially all that needs to happen is to append an ASCII nul
character and create a CString from it. Is there a good way to do that? If not, is is possible to access that buffer directly?
Here is some example code:
...ANSWER
Answered 2019-Jan-26 at 00:31On Unix-like systems, you can obtain the raw bytes of an OsStr
or OsString
as a &[u8]
via std::os::unix::ffi::OsStrExt::as_bytes
. You can pass that slice directly to CString::new
.
On Windows, you cannot obtain the raw bytes of an OsStr
or OsString
. The WTF-8 encoding is considered a private implementation detail. The only guarantee is that if the string contains valid Unicode, then it can be converted to a str
or String
in constant time, using OsStr::to_str
or OsString::into_string
. You can also convert the string back to potentially ill-formed UTF-16 with std::os::windows::ffi::OsStrExt::encode_wide
.
The motivation for not giving direct access to the raw bytes is that almost no library expects strings encoded as WTF-8. In fact, some libraries might not even expect UTF-8! (They might instead expect strings encoded in the current "ANSI" code page.) If it turns out that the library doesn't expect UTF-8 strings, you should instead convert the potentially ill-formed UTF-16 string to the expected encoding using WideCharToMultiByte
.
QUESTION
I'm trying to define the set of 16-bit slices (Rust: &[u16]
) that are valid WTF-8 (when re-encoded), but not valid UTF-8 (when re-encoded), so that I can randomly generate such a slice. This in an effort to generate all the possible std::ffi::OsString
s on Windows machines that do not parse into a String
.
The conversion &[u16] -> OsString
is done via std::os::windows::ffi::OsStringExt::from_wide
. This redirects into libstd/sys_common/wtf8.rs
which defines the operation as:
ANSWER
Answered 2017-Dec-11 at 10:50It isn't completely clear to me whether you want to generate a string in WTF-16 \ UTF-16
or WTF-8 \ UTF-8
. I think generating a WTF-16 string that isn't valid UTF-16 is probably easier, so here it goes:
You need to make sure at least one (16-bit) "character" is a surrogate that is not part of a surrogate pair. (This example might also generate NUL
characters in the string.)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install wtf-8
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page