Skip to content

Commit 3aa7c01

Browse files
committed
Add locale_charset definition.
1 parent 01c6089 commit 3aa7c01

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/cppp/reiconv.hpp.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,19 @@ namespace reiconv
141141
*/
142142
extern _CPPP_API std::string convert(Encoding from, Encoding to, const std::string_view input, bool strict = true);
143143

144+
/**
145+
* @brief Determine the current locale's character encoding, and canonicalize it into one of
146+
* the canonical names.
147+
* @note The result must not be freed. It is statically allocated.
148+
* @note The result becomes invalid when `setlocale` is used to change the global locale, or
149+
* when the value of one of the environment variables `LC_ALL`, `LC_CTYPE`, `LANG` is changed.
150+
* Threads in multithreaded programs should not do this. If the canonical name cannot be
151+
* determined, the result is a non-canonical name.
152+
* @return The name of the current locale's character encoding.
153+
* @see Libiconv's `locale_charset`.
154+
*/
155+
extern _CPPP_API std::string_view locale_charset();
156+
144157
} // namespace reiconv
145158

146159
#endif // _CPPP_REICONV_HPP_

0 commit comments

Comments
 (0)