모듈:Unicode: 두 판 사이의 차이
보이기
새 문서: local ustring = mw.ustring local p = {} function p.tounicode( frame ) local char = frame.args[1] or nil if char then return p.tounicode_(char) else return '입력값이 없습... |
편집 요약 없음 |
||
| 12번째 줄: | 12번째 줄: | ||
function p.tounicode_( char ) | function p.tounicode_( char ) | ||
if type(char) == 'string' then | if type(char) == 'string' then | ||
return 'U+'..ustring.upper( | return 'U+'..ustring.upper(ustring.format("%x", ustring.codepoint(char))) | ||
else | else | ||
return 0 | return 0 | ||
2021년 12월 22일 (수) 16:01 판
{{#css: .template-documentation {
clear: both; margin: 1em 0 0 0; padding: 1em
} /* 아래 상자 */ .mbox-text {
clear: both; background-color: #e8ffe8;
}
.template-documentation-template-data .mw-templatedata-doc-desc {
display: none;
}
}}
모듈:Unicode을 이용합니다.
스크립트 오류: 함수 "uni_char"가 존재하지 않습니다.
{{유니코드문자|[}}
스크립트 오류: 함수 "uni_char"가 존재하지 않습니다.
{{유니코드문자|이름=왼쪽 대괄호|[}}
아래는 가능한 모든 변수들을 나열한 것입니다.
스크립트 오류: 함수 "uni_char"가 존재하지 않습니다.
위 설명은 모듈:Unicode/설명문서의 내용을 가져와 보여주고 있습니다.
연습장이나 사용자 문서에서 틀의 사용이나 수정을 연습할 수 있습니다.
local ustring = mw.ustring
local p = {}
function p.tounicode( frame )
local char = frame.args[1] or nil
if char then
return p.tounicode_(char)
else
return '입력값이 없습니다.'
end
end
function p.tounicode_( char )
if type(char) == 'string' then
return 'U+'..ustring.upper(ustring.format("%x", ustring.codepoint(char)))
else
return 0
end
end
-- string.char
function p.char( frame )
local args = getArgs(frame)
local new_args = str._getParameters( args, { 'c' } )
local c = tonumber(new_args['c'])
return ustring.char( c )
end
return p