Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a697b373
Commit
a697b373
authored
Nov 21, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another temporary hack to debug the issue #13441
Dump the wchar_t that we are going to decode and dump the locale
parent
da29cc36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
Modules/_localemodule.c
Modules/_localemodule.c
+20
-0
No files found.
Modules/_localemodule.c
View file @
a697b373
...
...
@@ -72,6 +72,20 @@ str2uni(const char* s)
assert
(
res1
!=
(
size_t
)
-
1
);
#else
assert
(
res1
==
needed
);
#endif
#ifdef Py_DEBUG
{
size_t
i
;
printf
(
"Decode wchar_t {"
);
for
(
i
=
0
;
i
<
res1
;
i
++
)
{
wchar_t
ch
=
dest
[
i
];
if
(
i
)
printf
(
" U+%04x"
,
ch
);
else
printf
(
"U+%04x"
,
ch
);
}
printf
(
"} (len=%u)
\n
"
,
res1
);
}
#endif
res2
=
PyUnicode_FromWideChar
(
dest
,
res1
);
if
(
dest
!=
smallbuf
)
...
...
@@ -160,12 +174,18 @@ PyLocale_setlocale(PyObject* self, PyObject* args)
if
(
locale
)
{
/* set locale */
#ifdef Py_DEBUG
printf
(
"SET LOCALE
\"
%s
\"\n
"
,
locale
);
#endif
result
=
setlocale
(
category
,
locale
);
if
(
!
result
)
{
/* operation failed, no setting was changed */
PyErr_SetString
(
Error
,
"unsupported locale setting"
);
return
NULL
;
}
#ifdef Py_DEBUG
printf
(
"SET LOCALE -> %s
\n
"
,
result
);
#endif
result_object
=
str2uni
(
result
);
if
(
!
result_object
)
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment