C 지역화 함수
C 표준 라이브러리 |
---|
일반 주제 |
기타 주제 |
컴퓨팅에서 C 지역화 함수(C localization functions)는 기본적인 지역화 루틴을 구현한 C 프로그래밍 언어내 함수 모음이다.[1][2] 이 기능은 다국어 프로그램에서 사용되어 특정 로케일에 조정된다. 특히, 숫자나 통화를 표시하는 방법을 수정하는 데 쓰인다. 이 설정은 C 표준 라이브러리 내 입출력 함수의 동작에 영향을 준다.[3]
예시
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main(void)
{
/* Locale is set to "C" before this. This call sets it
to the "current locale" by reading environment variables: */
setlocale(LC_ALL, "");
const struct lconv * const currentlocale = localeconv();
printf("In the current locale, the default currency symbol is: %s\n",
currentlocale->currency_symbol);
return EXIT_SUCCESS;
}
같이 보기
각주
- ↑ 《ISO/IEC 9899:1999 specification》 (PDF). p. 204, § 7.11 Localization.
- ↑ Prata, Stephen (2004). 《C primer plus》. Sams Publishing. Appendix B, Section V: The Standard ANSI C Library with C99 Additions. ISBN 0-672-32696-5.
- ↑ “ISO/IEC 9899:201x” (PDF). 2011년 4월 12일. 181쪽. 2018년 3월 29일에 원본 문서 (PDF)에서 보존된 문서.