Failed to add path with wide character

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Failed to add path with wide character

J Decker
This fails under windows.

I have this project which uses the directory Λ  (Greek Lamba)

"mkdir Λ"
mtn add Λ


mtn.EXE: error: could not open directory 'dekcore/?': The filename,
directory name, or volume label syntax is incorrect.

1) the input from command line to main( int argc, char **argv ) gets a '?'
2) using GetCommandLine() returns command line with '?' in it.
3) using GetCOmmandLineW() returns with correct character in it, but
it's wchar_t*

In my own project today (after discovering this, and trying to locate
where the failure is)  I now do GetCommandLineW() convert it to utf-8,
parse it using windows command line rules (quoted things stay
together, otherwise break on spaces)  and then use it normally
internally until I get to the file system again, which I do convert
the utf-8 string to wchar_t ( which is probably UCS2 and not UTF16)
and then pass the filename to wfopen()... ( CreateFileW() if
appropriate ).




C:\>mtn genkey Λ@Λ.com
mtn.EXE: misuse: bad character '?' in key name '?@?.com'

_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: Failed to add path with wide character

Markus Wanner-2
On 04/21/2016 01:20 AM, J Decker wrote:
> This fails under windows.
>
> I have this project which uses the directory Λ  (Greek Lamba)
>
> "mkdir Λ"
> mtn add Λ

Thanks for your report. I vaguely remember that monotone has encoding
issues on Windows.

I also noticed that the recently added colorization feature breaks
things on (non-cygwin-)Windows, so I guess I'll have to look at that OS
rather sooner than later.

Kind Regards

Markus Wanner


_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: Failed to add path with wide character

J Decker
int ConvertToUTF16( wchar_t *output, TEXTRUNE rune )
https://github.com/d3x0r/SACK/blob/master/src/typelib/text.c#L2735

int ConvertToUTF8( char *output, TEXTRUNE rune )
https://github.com/d3x0r/SACK/blob/master/src/typelib/text.c#L2760

/* CTEXTSTR is LPTSTR, that is with _UNICODE it's wchar_t without it's char */
TEXTRUNE GetUtfChar( CTEXTSTR *from )
https://github.com/d3x0r/SACK/blob/master/src/typelib/text.c#L3094


*shrug*

I know there's a 'unicode' library but it's truly large.. and
certainly wcstombs/mbstowcs are useless in this regard... they do add
up to a couple hundred lines of code....

http://utf8everywhere.org/

binary equivalence is sufficient; I know that tecnically canonical
conversions (changing characters to other characters that are really
the same shape) apply... but I know that sqlite takes what you give it
and doesn't care, and I know that sockets take and send stuff and
don't care... so I don't really know what sorts of applications I
would even remotely touch that did canonical replacements that destroy
binary equivalence.

On Thu, Apr 21, 2016 at 2:13 AM, Markus Wanner <[hidden email]> wrote:

> On 04/21/2016 01:20 AM, J Decker wrote:
>> This fails under windows.
>>
>> I have this project which uses the directory Λ  (Greek Lamba)
>>
>> "mkdir Λ"
>> mtn add Λ
>
> Thanks for your report. I vaguely remember that monotone has encoding
> issues on Windows.
>
> I also noticed that the recently added colorization feature breaks
> things on (non-cygwin-)Windows, so I guess I'll have to look at that OS
> rather sooner than later.
>
> Kind Regards
>
> Markus Wanner
>
>
> _______________________________________________
> Monotone-devel mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/monotone-devel

_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel