Q&A

인쇄하기

Home › 커뮤니티 › Q&A

유튜브 브랜딩을 위한 채널맞춤설정 3-3, 기본정보 설정, 채널이름 URL 맞춤링크 연락처 등으로 구독자...

페이지 정보

profile_image
작성자 Dorothy
댓글 0건 조회 20회 작성일 24-09-03 03:00

본문

CString 한글URL 으로 url 를 받아서 BrowserWindowEdge 모듈에 navigate 할때... 필요하다..한글이 url 에 있는 경우 필요했다.. 특정 문서를 다운로드 받는 링크인데.. 링크문서가 한글URL 한글일때...한글만 인코딩해서 그부분만 replace 해주고 브라우저든 enbeded 모듈이든 사용하면 되더라...Encoding and Decoding site. e.g. HTML Escape / URL Encoding / 한글URL Base64 / MD5 / SHA-1 / CRC32 / and many other String, Number, DateTime, Color, Hash formats!ex)​CString strkor ϞxtractHangulCharacters(m_strurl) //우선 한글URL 한글 추출​std::wstring strUni 𽲢W(strkor)std::wstring_convertconverter;std::string strUTF8 Ϝonverter.to_bytes(strUni);std::string stdres =ToUpperCase(URLEncodeUTF8(strUTF8));CString strEnCode;strEnCode =stdres.c_str();m_strurl.Replace(strkor, strEnCode);​결과값이 아래처럼 된다.​​#include ;#include ;#include ;#include ;std::string URLEncodeUTF8(const std::string&strUTF8) {std::ostringstream 한글URL escaped;escaped.fill('0');escaped <<std::hex;​for (char c : strUTF8) {// 안전한 문자는 그대로 유지, 특수문자는 URL 인코딩if (c =='-'|| c =='_'|| c =='.'|| 한글URL c =='~') {escaped <<c;}else if (c =='') {escaped <<'+';}else {escaped ;(c));}}​return escaped.str();}​std::string ToUpperCase(const std::string&input) {std::string result =input​for (char&c : result) 한글URL {c =std::toupper(c);}​return result;}​#define HANGULMSK 0x80CString ExtractHangulCharacters(const CString&input) {CString result;CString stmp;​int len =input.GetLength();int i ϐWORD wHangul;while (i <len) {wchar_t ch =input[i];​char 한글URL cName;cName =input.GetAt(i);if (cName &HANGULMSK){stmp =input.Mid(i, 2);result +=stmp;i++;}else if (cName =='('|| cName ==')') //특수문자는 여기서 추가해줘서 한바이트로 처리하도록{stmp =input.Mid(i, 1);result +=stmp;}​i++;}return 한글URL result;}

댓글목록

등록된 댓글이 없습니다.